DirectXShaderCompiler
DirectXShaderCompiler copied to clipboard
[SPIR-V] Fix static const in push constants
Struct lowering is slightly different for push constants, and we didn't checked if the field was static or not.
In SPIR-V, when a field is const static, we either replace all loads by a the immediate (when usage is Struct::field), or create a global variable we initialize to the correct value and reference instead. The field is then ignored from the struct definition, and this variable is used.
This hasn't changed with this commit, I just made push-buffers use the same logic.
Fixed #6006