feat: add more shader group diagnostics to compile_report#2085
Merged
lgritz merged 2 commits intoAcademySoftwareFoundation:mainfrom Mar 5, 2026
Merged
feat: add more shader group diagnostics to compile_report#2085lgritz merged 2 commits intoAcademySoftwareFoundation:mainfrom
lgritz merged 2 commits intoAcademySoftwareFoundation:mainfrom
Conversation
When compile_report >= 1, report three new post-optimization stats for the shader group: - Number of active (non-unused) layers - Maximum connection depth of the shader network (node count along the longest layer-to-layer chain, so a single unconnected node = 1 and a chain A->B->C = 3) - Number of texture ops (texture, environment, gettextureinfo, texture3d) Coded via pair programming with Claude Code, using the Claue Sonnet 4.6 model. Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Larry Gritz <lg@larrygritz.com>
Collaborator
Author
|
Hang on, don't review yet; I want to add one more stat, testing now. |
Collaborator
Author
|
Amended to also count the number of noise calls in the post-optimized shader. Ok to review now. |
fpsunflower
approved these changes
Mar 4, 2026
Contributor
fpsunflower
left a comment
There was a problem hiding this comment.
LGTM
Would be curious to see the types of results you get from your production shaders ...
Collaborator
Author
The use is speculative, and may be subject to further refinement. I think we're looking for some way to leave breadcrumbs behind in the logs so that when a render is absurdly expensive, people can make a good guess about whether there is any particular material that looks so out of whack that maybe it's a possible culprit. |
a0eb54e
into
AcademySoftwareFoundation:main
99 of 102 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When compile_report >= 1, report several new post-optimization stats for the shader group:
Note that these stats (number of layers, texture ops, noise ops) are the total number in the post-optimized shader, but not the number that will be run on any particular execution of the shader. Trivial example: the noise calls may all be inside an "if" statement with a condition that is never true in practice, but that can't be known ahead of time. In the other direction, a loop with noise calls in the body will underestimate how many calls are made in each shader run. So take with a grain of salt -- these stats are related overall shader code complexity, but not necessarily to execution cost.
Coded via pair programming with Claude Code, using the Claude Sonnet 4.6 model.