summaryrefslogtreecommitdiffstats
path: root/tests/cuda
diff options
context:
space:
mode:
authorMukund Keshava <mkeshava@nvidia.com>2025-05-27 17:46:04 +0530
committerGitHub <noreply@github.com>2025-05-27 20:16:04 +0800
commitf570e109c4039e15526af38e17f350c115327489 (patch)
tree9698566e3b2dcbce33a21c80bcc17b4824b2f168 /tests/cuda
parent914f8c4b283bd81f2ea3ef00b184ff63245c9278 (diff)
Add LSS intrinsics (#7200)
* WiP: LSS intrinsics: initial commit * format code * Fix CI failures * Address review comment --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
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