summaryrefslogtreecommitdiff
path: root/tests/cuda
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cuda')
-rw-r--r--tests/cuda/lss-test.slang34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/cuda/lss-test.slang b/tests/cuda/lss-test.slang
new file mode 100644
index 000000000..4b0512cb1
--- /dev/null
+++ b/tests/cuda/lss-test.slang
@@ -0,0 +1,34 @@
+//TEST:SIMPLE(filecheck=CHECK): -target cuda
+//CHECK_: __global__ void __closesthit__closestHitShaderLss
+//CHECK: optixGetSpherePositionAndRadius
+//CHECK: optixObjectPositionsAndRadii
+//CHECK: optixIsSphereHit
+//CHECK: optixIsLSSHit
+
+struct RayPayload
+{
+ float4 color;
+ float2x4 lssData;
+ bool isSphere;
+ bool isLss;
+};
+
+[shader("closesthit")]
+void closestHitShaderLss(inout RayPayload payload, in BuiltInTriangleIntersectionAttributes attr)
+{
+ // Test TraceRay API functions
+ payload.color = GetSpherePositionAndRadius();
+ payload.lssData = GetLssPositionsAndRadii();
+ payload.isSphere = IsSphereHit();
+ payload.isLss = IsLssHit();
+
+// TODO: This will be enabled once issue #6647 is completed.
+#if 0
+ // Test HitObject API functions
+ HitObject hitObj;
+ float4 sphereData = hitObj.GetSphereObjectPositionAndRadius();
+ float2x4 lssData = hitObj.GetLssObjectPositionsAndRadii();
+ bool isSphereHit = hitObj.IsSphereHit();
+ bool isLssHit = hitObj.IsLssHit();
+#endif
+} \ No newline at end of file