llvm-project
2fcb2d34 - [hlsl][spirv] Dont emit string constants for resource names (#243531)

Commit
1 day ago
[hlsl][spirv] Dont emit string constants for resource names (#243531) Resource intrinsics (handlefrombinding, handlefromimplicitbinding) take const char * arguments which get lowered in backend into byte arrays in the final spirv module. These should be ignored except to provide the literal to OpName instructions. Add a pass intentionally before SPIRVRemoveUnusedResources and SPIRVLegalizeResourceBinding, which converts handle intrinsics to variants taking a metadata arg for the name instead. This lets us avoid emitting actual constants in the spirv, which requires int8 capability, and simplifies, for example, string global removal in the unused resources pass, and lowering of heap resources to handlefrombinding. It would be preferable to emit these metadata variants from Clang, but this is not currently possible due to handlefrombinding generation taking place in generated initializers, eg __createFromBinding, so a string arg must be passed initially. Fixes #241741 assisted by: codex
Author
Parents
Loading