summaryrefslogtreecommitdiffstats
path: root/tests/modules/hit.slang
diff options
context:
space:
mode:
authorvenkataram-nv <vedavamadath@nvidia.com>2024-08-16 23:08:00 -0700
committerGitHub <noreply@github.com>2024-08-16 23:08:00 -0700
commit25bc5a3ada5a2404f25ecf2de7d035ba60cd9fdf (patch)
tree8cb0092f1bf09756f3e1adca60963413742413fe /tests/modules/hit.slang
parentb411c05bc074f53037e32b23583b85adcfbf81fc (diff)
Avoiding the use of the global AST builder in DeclRefType::create (#4866)
Diffstat (limited to 'tests/modules/hit.slang')
-rw-r--r--tests/modules/hit.slang24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/modules/hit.slang b/tests/modules/hit.slang
new file mode 100644
index 000000000..d175275b4
--- /dev/null
+++ b/tests/modules/hit.slang
@@ -0,0 +1,24 @@
+//TEST:COMPILE: tests/modules/environment.slang -o tests/modules/environment.slang-module
+//TEST:COMPILE: tests/modules/hit.slang -stage closesthit -entry closesthit -target dxil -o monolithic.dxil
+
+import environment;
+
+StructuredBuffer <Environment_sample_data> environment_sample_buffer;
+
+float3 sample_lights(inout uint seed)
+{
+ return environment_sample(environment_sample_buffer, seed);
+}
+
+struct RadianceHitInfo
+{
+ float3 contribution;
+};
+
+struct Attributes
+{
+ float2 bary;
+};
+
+[shader("closesthit")]
+void closesthit(inout RadianceHitInfo payload, Attributes attrib) {}