See Issues list in the Khronos SPIRV-Registry repository: https://github.com/KhronosGroup/SPIRV-Registry
This extension is written against the SPIR-V Specification, Version 1.2 Revision 4, Unified.
This extension requires SPIR-V 1.0.
This extension also subsumes the SPV_GOOGLE_decorate_string extension.
This extension provides two new decorations to extend HLSL functionality: HlslCounterBuffer and HlslSemantic.
The decoration HlslCounterBuffer is used with OpDecorateId to link a counter buffer to a UAV resource that has an associated counter.
The decoration HlslSemantic is used with OpDecorateStringGOOGLE and OpMemberDeocrateStringGOOGLE to decorate an input or output variable id with a string representing semantic as defined in the HLSL source. The decoration HlslSemantic can also be used with future string decorations that may get added to SPIR-V.
To use this extension within a SPIR-V module, the following OpExtension must be present in the module:
OpExtension "SPV_GOOGLE_hlsl_functionality1"
- (Modify Section 3.20, Decoration)
Decoration | Enabling Capabilities | Extra Operands | ||
---|---|---|---|---|
5634 |
HlslCounterBufferGOOGLE |
<id> |
||
5635 |
HlslSemanticGOOGLE |
Literal String |
- (Modify Section 3.32 "Instructions")
-
In the OpDecorateId instruction’s Capability box, remove the statement "Missing before version 1.2", to allow this instruction to be used with this extension. Also, in the description of the OpDecorateId instruction, change "All such <id> Extra Operands must be constant instructions." to "All such <id> Extra Operands must be constant instructions or the result <id> of OpVariable instructions."
An OpExtension must be added to the SPIR-V for validation layers to check legal use of this extension:
OpExtension "SPV_GOOGLE_hlsl_functionality1"
HLSLCounterBuffer can only be applied to a variable in the Uniform storage class. The parameter should also be a variable in the Uniform storage class.
HLSLSemantic can only be applied to a variable or a member of a struct type. If applied to a variable, it must be in the Input or Output storage class.
Rev | Date | Author | Changes |
---|---|---|---|
1 |
2018-02-04 |
Hai Nguyen |
Initial draft |
2 |
2018-02-16 |
Hai Nguyen |
Added GOOGLE suffix, validation rules, and token numbers |
3 |
2018-03-16 |
Lei Zhang |
Clarified version and extension requirements |
4 |
2018-04-13 |
Lei Zhang |
Subsumed the SPV_GOOGLE_decorate_string extension |
5 |
2018-09-12 |
Lei Zhang |
Allowed OpDecorateId to take result <id> of OpVariable |