DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

[SPIR-V] Fix static const in push constants

Open Keenuts opened this issue 1 year ago • 0 comments

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

Keenuts avatar Mar 12 '24 15:03 Keenuts