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 /tests/cuda | |
| 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 'tests/cuda')
| -rw-r--r-- | tests/cuda/optix-cluster.slang | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/cuda/optix-cluster.slang b/tests/cuda/optix-cluster.slang new file mode 100644 index 000000000..151b9c7dd --- /dev/null +++ b/tests/cuda/optix-cluster.slang @@ -0,0 +1,17 @@ +//TEST:SIMPLE(filecheck=CHECK): -target cuda +//CHECK: __global__ void __closesthit__closestHitShaderA +//CHECK: optixGetClusterId +struct RayPayload +{ + float4 color; +}; + +[shader("closesthit")] +void closestHitShaderA(inout RayPayload payload, in BuiltInTriangleIntersectionAttributes attr) +{ + int clusterId = GetClusterID(); + float4 color = float4(0, 0, 0, 1); + if (clusterId >= 0) + color[clusterId] = 1; + payload.color = color; +} |
