Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More comprehensive warnings about things that don't optimize away #1497

Merged
merged 1 commit into from
May 2, 2022

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Apr 29, 2022

New classes of warnings triggered when enabling option "opt_warnings":

  • Creation of new strings mid-shader.
  • Access to the characters of strings mid-shader.

We already warned about texture access by name that could not be
turned into a handle.

In all of these cases, we only warn after runtime optimization, so that shader
idioms in the source code that appear to do these forbidden things will not warn
as long as they can be reduced to safe operations in the course of the runtime
optimization step.

Signed-off-by: Larry Gritz [email protected]

/// int opt_warnings Warn on failure to runtime-optimize certain
/// shader constructs. (0)
/// int gpu_opt_error Issue a hard error if certain shader
/// constructs cannot be optimized away, which
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we turn on gpu_opt_error even if we are running on the cpu? (In order to get a shader into shape before trying the GPU)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is 100% the point, yes.

Copy link
Contributor

@AlexMWells AlexMWells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

New classes of warnings triggered when enabling option "opt_warnings":

* Creation of new strings mid-shader.
* Access to the characters of strings mid-shader.

We already warned about texture access by name that could not be
turned into a handle.

In all of these cases, we only warn *after* runtime optimization, so that shader
idioms in the source code that appear to do these forbidden things will not warn
as long as they can be reduced to safe operations in the course of the runtime
optimization step.

Signed-off-by: Larry Gritz <[email protected]>
@lgritz lgritz requested a review from lkerley May 2, 2022 18:38
@lgritz
Copy link
Collaborator Author

lgritz commented May 2, 2022

@lkerley FYI

@lgritz lgritz merged commit 0a55421 into AcademySoftwareFoundation:main May 2, 2022
@lgritz lgritz deleted the lg-warning branch May 3, 2022 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants