-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Apply specialization to shader reflection #2329
Conversation
This doesn't fix #1956. The issue also isn't a bug, so the label is incorrect. As I commented, the issue is that they are trying to use vulkano-shaders, which generates Rust types at compile-time, with an array that is runtime-sized, which is impossible. From what I can tell vulkano-shaders is working exactly as intended there. |
Good point, I had missed that the issue was with Vulkano-shaders specifically. Should we just close it as wontfix then? |
Question is whether they would find vulkano-shaders that doesn't generate Rust types useful. |
Looks good, thanks! |
* Apply specialization to shader reflection * Remove redundant method * Remove all the SpecId decorations too * Don't unnecessarily collect the instructions * Replace decoration groups with individual decorations * Rename with_specialization * Missed renames * Remove the Arcs
Changelog:
Shader specialization has been moved to its own type,
SpecializedShaderModule
. You create this from a regularShaderModule
by callingwith_specialization
, and it has methods to create an entry point. The old entry point methods that were directly onShaderModule
are still there, but they are now simply shortcuts for callingwith_specialization
with no specialization constants, and then calling the corresponding entry point method ofSpecializedShaderModule
.When you create a
SpecializedShaderModule
, a replacement pass is made through the reflected SPIR-V module, replacing all specialization constants with regular constants, applying the provided specialization constants where applicable.OpSpecConstantOp
instructions are also evaluated in this pass, which was by far the most complex part of this PR, and also the most likely to have bugs I missed.