diff options
| author | Harsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com> | 2025-05-12 13:05:34 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-12 07:35:34 +0000 |
| commit | 64a43b17a76d7a8269f55cbe67ef708cd464774c (patch) | |
| tree | 089fc256a8c10eba17873c5458804ad1714dd5e9 /source/slang/glsl.meta.slang | |
| parent | 03f9242489d5598c9c7594ac12e269f57a018cda (diff) | |
cluster acceleration structure optix 6431 (#7028)
* Add cluster geometry intrinsics for ray tracing
- Added GetClusterID() method to HitObject class
- Added CandidateClusterID() and CommittedClusterID() methods to
RayQuery class
- Added SPV_NV_cluster_acceleration_structure extension support
- Added GL_NV_cluster_acceleration_structure extension support
- Added test files for RayQuery and HitObject cluster methods
Fixes #6431
* OpRayQueryGetIntersectionClusterIdNV - unrecognized spirv
Disabling spirv backend for SPV_NV_cluster_acceleration_structure
hlsl.meta.slang(18674): error 29100: unrecognized spirv opcode:
OpRayQueryGetIntersectionClusterIdNV
result:$$int = OpRayQueryGetIntersectionClusterIdNV
&this $iCandidateOrCommitted;
^~~~~~
hlsl.meta.slang(18670): error 30019: expected an expression of type
'int', got 'void'
return spirv_asm
^~~~~~~~~
ninja: build stopped: subcommand failed.
* 6431 - Fix spirv opcode
* Remove tests
* Add relevant tests
* Review - Simplify tests
Diffstat (limited to 'source/slang/glsl.meta.slang')
| -rw-r--r-- | source/slang/glsl.meta.slang | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/slang/glsl.meta.slang b/source/slang/glsl.meta.slang index 00ad88add..05cef836c 100644 --- a/source/slang/glsl.meta.slang +++ b/source/slang/glsl.meta.slang @@ -4893,6 +4893,35 @@ public property uint gl_HitKindEXT } } +public property int gl_ClusterIDNV +{ + [require(glsl_spirv, raytracing_anyhit_closesthit)] + get + { + setupExtForRayTracingBuiltIn(); + __target_switch + { + case glsl: + { + __requireTargetExtension("GL_NV_cluster_acceleration_structure"); + __intrinsic_asm "(gl_ClusterIDNV)"; + } + case spirv: + { + return spirv_asm + { + OpCapability RayTracingClusterAccelerationStructureNV; + OpExtension "SPV_NV_cluster_acceleration_structure"; + result:$$int = OpLoad builtin(ClusterIDNV:int); + }; + } + } + } +} +// Constant to indicate that a cluster acceleration structure was not hit. +// Corresponds to VK_GEOMETRY_INSTANCE_CLUSTER_ID_NONE_NV in Vulkan +public static const int gl_ClusterIDNoneNV = -1; + public property mat4x3 gl_ObjectToWorldEXT { [require(glsl_spirv, raytracing_anyhit_closesthit_intersection)] |
