Name Strings
SPV_NV_shader_invocation_reorder
Contact
See Issues list in the Khronos SPIRV-Registry repository: https://github.com/KhronosGroup/SPIRV-Registry
Contributors
-
Ashwin Lele, NVIDIA
-
Eric Werness, NVIDIA
-
Daniel Koch, NVIDIA
-
Pankaj Mistry, NVIDIA
Status
-
Complete
Version
Last Modified Date |
2023-12-06 |
Revision |
2 |
Dependencies
This extension is written against the Unified SPIR-V Specification, Version 1.6, Revision 1.
This extension requires SPIR-V 1.4.
This extension requires SPV_KHR_ray_tracing.
This extension requires SPV_EXT_physical_storage_buffer, SPV_KHR_physical_storage_buffer or SPIR-V 1.5.
This extension interacts with SPV_NV_ray_tracing_motion_blur.
Overview
This extension adds hit objects and reordering builtins to provide finer grain control over traversal during ray tracing.
Extension Name
To use this extension within a SPIR-V module, the following OpExtension must be present in the module:
OpExtension "SPV_NV_shader_invocation_reorder"
New Capabilities
This extension introduces new capabilities:
ShaderInvocationReorderNV
New Storage Classes
Storage classes added under the ShaderInvocationReorderNV capability
HitObjectAttributeNV
New Decorations
This extension introduces new decorations:
HitObjectShaderRecordBufferNV
New Instructions
Instructions added under the ShaderInvocationReorderNV capability
OpTypeHitObjectNV OpReorderThreadWithHintNV OpReorderThreadWithHitObjectNV OpHitObjectIsMissNV OpHitObjectIsHitNV OpHitObjectIsEmptyNV OpHitObjectGetRayTMinNV OpHitObjectGetRayTMaxNV OpHitObjectGetObjectRayOriginNV OpHitObjectGetObjectRayDirectionNV OpHitObjectGetWorldRayOriginNV OpHitObjectGetWorldRayDirectionNV OpHitObjectGetObjectToWorldNV OpHitObjectGetWorldToObjectNV OpHitObjectGetInstanceCustomIndexNV OpHitObjectGetInstanceIdNV OpHitObjectGetGeometryIndexNV OpHitObjectGetPrimitiveIndexNV OpHitObjectGetHitKindNV OpHitObjectGetAttributesNV OpHitObjectGetCurrentTimeNV OpHitObjectGetShaderBindingTableRecordIndexNV OpHitObjectGetShaderRecordBufferHandleNV OpHitObjectExecuteShaderNV OpHitObjectRecordMissNV OpHitObjectRecordMissMotionNV OpHitObjectRecordHitWithIndexNV OpHitObjectRecordHitWithIndexMotionNV OpHitObjectRecordHitNV OpHitObjectRecordHitMotionNV OpHitObjectRecordEmptyNV OpHitObjectTraceRayNV OpHitObjectTraceRayMotionNV
Modifications to the SPIR-V Specification
- (Modify Section 2.2.1, Instructions )
-
Add OpTraceRayWithHitObjectNV, OpHitObjectExecuteShaderNV to the list of shader call instructions.
- (Add the following terminology to section 2.2.2, Types)
-
Hit object type: The type returned by OpTypeHitObjectNV.
- (Add to the list of opaque types in section 2.2.2, Types)
-
-
OpTypeHitObjectNV
-
- (Modify Section 3.2, Decorations, adding a row to the Decoration table)
-
Decoration Requires 5386
ShaderInvocationReorderNV
HitObjectShaderRecordBufferNV
- (Modify Section 3.7, Storage Class, adding rows to the Storage Class table)
-
Storage Class Enabling Capabilities Enabled by Extension 5385
HitObjectAttributeNV
Used for storing attributes of geometry intersected by a ray to be passed on to hit object instructions. Visible across all functions in the current invocation. Not shared externally. Variables declared with this storage class can be both read and written to, but cannot have initializers. Only allowed in RayGenerationKHR, ClosestHitKHR, and MissKHR execution models.ShaderInvocationReorderNV
SPV_NV_shader_invocation_reorder
- (Modify Section 3.31, Capability, adding a row to the Capability table)
-
Capability Implicitly Declares 5383
ShaderInvocationReorderNV
RayTracingKHR
- (Add the following line to the description of OpTypePointer, in Section 3.32.6, Type-Declaration Instructions)
-
If Type is OpTypeHitObjectNV, Storage Class must be Private or Function.
- (Add the following line to the description of OpStore and OpLoad, in Section 3.32.8, Memory Instructions)
-
The Type operand to the OpTypePointer used for Pointer must not be OpTypeHitObjectNV.
- (Add the following line to the description of OpCopyMemory and OpCopyMemorySized, in Section 3.32.8, Memory Instructions)
-
The Type operand to the OpTypePointer used for Target or Source must not be OpTypeHitObjectNV.
- (Add a new sub section 3.36.Reorder Instructions)
-
- (Add a new sub section 3.36.Hit Object Instructions)
-
The semantics of the arguments of OpHitObjectTraceRayNV and OpHitObjectTraceRayMotionNV are same as those with the same names of OpTraceRayKHR and OpTraceRayMotionNV as defined in the SPV_KHR_ray_tracing and SPV_NV_ray_tracing_motion_blur extensions, respectively.
- (Modify Section 3.36.6, Type-Declaration Instructions, adding a new table)
Validation Rules
An OpExtension must be added to the SPIR-V for validation layers to check legal use of this extension:
OpExtension "SPV_NV_shader_invocation_reorder"
Interactions with SPV_NV_ray_tracing_motion_blur
If the SPV_NV_ray_tracing_motion_blur extension is not supported, the OpHitObjectTraceRayMotionNV, OpHitObjectRecordHitMotionNV, OpHitObjectRecordHitWithIndexMotionNV, and OpHitObjectRecordMissMotionNV instructions are not supported.
Issues
None
Revision History
Rev | Date | Author | Changes |
---|---|---|---|
1 |
2022-09-01 |
Ashwin Lele |
Internal revisions |
2 |
2023-12-06 |
Daniel Koch |
Remove references to non-existant SPIR-V definitions |