-
Notifications
You must be signed in to change notification settings - Fork 358
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
Elide dot nodes to avoid local sampler creation #1152
Merged
jstone-lucasfilm
merged 3 commits into
AcademySoftwareFoundation:main
from
kwokcb:dot_optimization
Jan 14, 2023
Merged
Elide dot nodes to avoid local sampler creation #1152
jstone-lucasfilm
merged 3 commits into
AcademySoftwareFoundation:main
from
kwokcb:dot_optimization
Jan 14, 2023
Conversation
This file contains 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
@niklasharrysson, I added in |
Signed-off-by: Jonathan Stone <jstone@lucasfilm.com>
jstone-lucasfilm
changed the title
Optimize out "dot" nodes to avoid local sampler creation.
Elide dot nodes to avoid local sampler creation
Jan 6, 2023
jstone-lucasfilm
approved these changes
Jan 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks @kwokcb!
jstone-lucasfilm
added a commit
that referenced
this pull request
Feb 18, 2023
This changelist fixes a bug in the elision of dot nodes (#1152), where dot nodes with channels attributes would be incorrectly bypassed, causing the shader generator to produce incorrect code.
This was referenced Sep 7, 2023
jstone-lucasfilm
pushed a commit
that referenced
this pull request
Sep 8, 2023
Dot nodes were elided in #1152 to prevent creating extra samplers in rasterized shadergen. This preserves the change written by @kwokcb while keeping the distinction between a topological constant node and a non-topological dot node. In scenarios where you want to feed a single color to multiple shader nodes in a complex material, using a constant node will force recompilation every time the color is tweaked, we want users to be able to use a dot node to feed the graph, which should allow tweaking the color without having to recompile the shader. Also allows re-using the shader code for material instances differing on this input color.
JGamache-autodesk
added a commit
to Autodesk/maya-usd
that referenced
this pull request
Sep 11, 2023
The MaterialX topological node list was in need of an update: For MaterialX 1.38.7: "dot" nodes are now topological. Via AcademySoftwareFoundation/MaterialX#1152 For upcoming MaterialX 1.38.8: "dot" node no longer elided (except for filenames) "switch" node no longer elided Via AcademySoftwareFoundation/MaterialX#1522
Michaelredaa
pushed a commit
to Michaelredaa/MaterialX
that referenced
this pull request
Oct 21, 2023
…ation#1152) A dot node is equivalent to a pass-through so bypass it during shader optimization. This fixes the issue of dot nodes creating intermediate samplers within functions for GLSL which is disallowed.
Michaelredaa
pushed a commit
to Michaelredaa/MaterialX
that referenced
this pull request
Oct 21, 2023
This changelist fixes a bug in the elision of dot nodes (AcademySoftwareFoundation#1152), where dot nodes with channels attributes would be incorrectly bypassed, causing the shader generator to produce incorrect code.
Michaelredaa
pushed a commit
to Michaelredaa/MaterialX
that referenced
this pull request
Oct 21, 2023
…tion#1522) Dot nodes were elided in AcademySoftwareFoundation#1152 to prevent creating extra samplers in rasterized shadergen. This preserves the change written by @kwokcb while keeping the distinction between a topological constant node and a non-topological dot node. In scenarios where you want to feed a single color to multiple shader nodes in a complex material, using a constant node will force recompilation every time the color is tweaked, we want users to be able to use a dot node to feed the graph, which should allow tweaking the color without having to recompile the shader. Also allows re-using the shader code for material instances differing on this input color.
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.
Fix
dot
nodescreating intermediate samplers within functions for GLSL which is disallowed.
Implementation
Example
This will generate properly now