-
Notifications
You must be signed in to change notification settings - Fork 252
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
Add an example for reflection of parameter blocks #6161
Merged
csyonghe
merged 11 commits into
shader-slang:master
from
tangent-vector:reflection-parameter-block-example
Jan 28, 2025
Merged
Add an example for reflection of parameter blocks #6161
csyonghe
merged 11 commits into
shader-slang:master
from
tangent-vector:reflection-parameter-block-example
Jan 28, 2025
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
The example loads a shader program, compiles it for Vulkan, and then uses reflection information to set up descriptor set layouts and a pipeline layout. It then validates that the pipeline layout that is created is compatible with the compiled code, by using them together to make a pipeline state object with the validation layer enabled. The basic flow of the application follows the presentation in the companion article, and references its sections. This is example could be expanded in a few ways: * A D3D12 path could be added, to show the comparable operations for creating a root signature from reflection data * The existing shader could be modified to touch/use more of its parameter data, to help ensure that any errors would be caught by the validation layer * The set of shader files/modules that get loaded automatically could be expanded, to test more cases * The code could be expanded to handle more than just compute shaders, by allowing for multiple-entry-point files to be loaded for rasterization or ray-tracing pipelines
Need to fix build and format errors. |
/format |
🌈 Formatted, please merge the changes from this PR |
…block-example Format code for PR shader-slang#6161
/format |
🌈 Formatted, please merge the changes from this PR |
csyonghe
approved these changes
Jan 28, 2025
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.
The example loads a shader program, compiles it for Vulkan, and then uses reflection information to set up descriptor set layouts and a pipeline layout. It then validates that the pipeline layout that is created is compatible with the compiled code, by using them together to make a pipeline state object with the validation layer enabled.
The basic flow of the application follows the presentation in the companion article, and references its sections.
This is example could be expanded in a few ways:
A D3D12 path could be added, to show the comparable operations for creating a root signature from reflection data
The existing shader could be modified to touch/use more of its parameter data, to help ensure that any errors would be caught by the validation layer
The set of shader files/modules that get loaded automatically could be expanded, to test more cases
The code could be expanded to handle more than just compute shaders, by allowing for multiple-entry-point files to be loaded for rasterization or ray-tracing pipelines