summaryrefslogtreecommitdiff
path: root/tests/cuda
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cuda')
-rw-r--r--tests/cuda/optix-cluster.slang17
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;
+}