Name Strings
SPV_NV_raw_access_chains
Contact
To report problems with this extension, please open a new issue at:
Contributors
-
Hans-Kristian Arntzen, Valve
-
Jeff Bolz, NVIDIA
-
Rodrigo Locatti, NVIDIA
Notice
Copyright (c) 2023 The Khronos Group Inc. Copyright terms at http://www.khronos.org/registry/speccopyright.html
Status
-
Complete
Version
Last Modified Date |
2024-01-17 |
Revision |
7 |
Dependencies
This extension is written against the SPIR-V Specification, Version 1.6 Revision 2.
This extension requires SPIR-V 1.0.
Overview
This extension exposes an interface similar to Direct3D structured buffers and byte address buffers, allowing shaders compiled from an HLSL source to generate more efficient code.
This adds the instruction OpRawAccessChainNV under the RawAccessChainsNV capability. An optional operand can be provided to control bounds checking.
Extension Name
To use this extension within a SPIR-V module, the following OpExtension must be present in the module:
OpExtension "SPV_NV_raw_access_chains"
Modifications to the SPIR-V Specification, Version 1.6
Validation Rules
Modify section 2.16.1. Universal Validation Rules:
In the section:
"It is invalid for a pointer to be an operand to any instruction other than:"
Add:
<<OpRawAccessChainNV,*OpRawAccessChainNV*>>
In the section:
"It is invalid for a pointer to be the Result <id> of any instruction other than:"
Add:
<<OpRawAccessChainNV,*OpRawAccessChainNV*>>
Change:
"All indexes in <<OpAccessChain,*OpAccessChain*>> and <<OpInBoundsAccessChain,*OpInBoundsAccessChain*>> that are <<OpConstant,*OpConstant*>> with type of <<OpTypeInt,*OpTypeInt*>> with a 'signedness' of 1 must not have their sign bit set."
To:
"All indexes in <<OpAccessChain,*OpAccessChain*>>, <<OpInBoundsAccessChain,*OpInBoundsAccessChain*>>, and <<OpRawAccessChainNV,*OpRawAccessChainNV*>> that are <<OpConstant,*OpConstant*>> with type of <<OpTypeInt,*OpTypeInt*>> with a 'signedness' of 1 must not have their sign bit set."
Change:
"An <<OpTypePointer, *OpTypePointer*>> pointing to a 16-bit scalar, a 16-bit vector, or a composite containing a 16-bit member can be used as the result type of <<OpVariable, *OpVariable*>>, or <<OpAccessChain, *OpAccessChain*>>, or <<OpInBoundsAccessChain, *OpInBoundsAccessChain*>>."
To:
"An <<OpTypePointer, *OpTypePointer*>> pointing to a 16-bit scalar, a 16-bit vector, or a composite containing a 16-bit member can be used as the result type of <<OpVariable, *OpVariable*>>, or <<OpAccessChain, *OpAccessChain*>>, or <<OpInBoundsAccessChain, *OpInBoundsAccessChain*>>, or <<OpRawAccessChainNV,*OpRawAccessChainNV*>>."
Change:
"An <<OpTypePointer, *OpTypePointer*>> pointing to an 8-bit scalar, an 8-bit vector, or a composite containing an 8-bit member can be used as the result type of <<OpVariable, *OpVariable*>>, or <<OpAccessChain, *OpAccessChain*>>, or <<OpInBoundsAccessChain, *OpInBoundsAccessChain*>>."
To:
"An <<OpTypePointer, *OpTypePointer*>> pointing to an 8-bit scalar, an 8-bit vector, or a composite containing an 8-bit member can be used as the result type of <<OpVariable, *OpVariable*>>, or <<OpAccessChain, *OpAccessChain*>>, or <<OpInBoundsAccessChain, *OpInBoundsAccessChain*>>, or <<OpRawAccessChainNV,*OpRawAccessChainNV*>>."
Modify section 2.6.2. Validation Rules for Shader Capabilities:
Add text to the decorations Restrict, Aliased, Volatile, Coherent, NonWritable, and NonReadable specifying that they can also be used on the result of OpRawAccessChainNV.
Capabilities
Modify Section 3.31, "Capability", adding these rows to the Capability table:
Capability | Depends On | |
---|---|---|
5414 |
RawAccessChainNV |
Shader |
Instructions
Add the following instruction:
OpRawAccessChainNV |
Capability: |
|||||||
7+ |
5398 |
<id> |
<id> |
<id> |
<id> |
<id> |
Optional |
If Pointer is the result of a OpRawAccessChainNV instruction, a valid Aligned memory operand must be defined.
This alignment must be at least the size of the component.
Raw Access Chain Operands
At the end of Section 3 "Binary Form", add:
Raw Access Chain Operands | Enabling Capabilities | |
---|---|---|
0x0 |
None |
|
0x1 |
RobustnessPerComponentNV |
RawAccessChainsNV |
0x2 |
RobustnessPerElementNV |
RawAccessChainsNV |
Revision History
Rev | Date | Author | Changes |
---|---|---|---|
1 |
2023-07-03 |
Rodrigo Locatti |
Initial revision. |
2 |
2023-07-06 |
Hans-Kristian Arntzen |
Misc refinements. |
3 |
2023-07-07 |
Rodrigo Locatti |
Add support for memory decorations to OpRawAccessChainEXT. |
4 |
2023-07-12 |
Rodrigo Locatti |
Define overflows on Offset. |
5 |
2023-08-29 |
Rodrigo Locatti |
Rename extension to SPV_NV_raw_access_chains. |
6 |
2023-09-29 |
Rodrigo Locatti |
Allow per-component bounds checking for non-zero strides. |
7 |
2024-01-17 |
Rodrigo Locatti |
Remove mentions to old decorations. |