Nodes: Access Remaining Compute Builtins #29469
Merged
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.
Description
Adds the ability to access compute built-ins that are already defined by default directly within TSL. There are a few changes I made that I think might deserve further consideration.
Enabling subgroups by default if the feature is accessible: I largely did this to obviate the need for further logic within ComputeBuiltin that enables subgroups and activates the built-in should it be requested, or creating a separate node specifically for subgroup_size. However, we might not want to enable subgroups by default in every shader.
Creating ComputeBuiltinNode: A lot of the logic is similar to AttributeNode, however, I figured it would be better to separate accessing these builtins from accessing vertex attributes, as they serve different purposes, even if they are both considered 'attributes' within the context of the NodeBuilder.