summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2021-03-15 09:27:48 -0700
committerGitHub <noreply@github.com>2021-03-15 09:27:48 -0700
commitd8150e70612b58fb1cfefa262d3d862a6e6e79ba (patch)
tree3a365fe5fea4a418e6b803968e4640b8739db41d /tests
parentfd304c6c02c73a0024f6d982b1936451e4812370 (diff)
Fix handling of RT accelerations structures for non-RT stages (#1753)
* Fix handling of RT accelerations structures for non-RT stages The recent change that added support for the `GL_EXT_ray_query` extension made is so that a shader that declares a `RaytracingAccelerationStructure` as an input to a non-RT shader stage but then never *uses* it wouldn't enable any RT extension, resulting in a compilation failure in glslang. This change reverts that behavior so that such shaders enable `GL_EXT_ray_tracing`, since that is the older of the two RT extensions that introduce `accelerationStructureEXT`. It is possible that we will need to revisit this decision based on which of the two extensions ends up being more broadly supported, but I think that right now it is fair to say that there exist drivers that support `GL_EXT_ray_tracing` but not `GL_EXT_ray_query`, so the former is the better default. * fixup: failing test
Diffstat (limited to 'tests')
-rw-r--r--tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang20
-rw-r--r--tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang.glsl17
-rw-r--r--tests/pipeline/ray-tracing/trace-ray-inline.slang2
-rw-r--r--tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl1
4 files changed, 39 insertions, 1 deletions
diff --git a/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang b/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang
new file mode 100644
index 000000000..9f18d353c
--- /dev/null
+++ b/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang
@@ -0,0 +1,20 @@
+// acceleration-structure-in-compute.slang
+
+// Test for using ray-tracing acceleration structures as a shader input
+// in non-ray-tracing shader code (that never actually traces rays)
+
+//TEST:CROSS_COMPILE:-target spirv-asm -stage compute -profile glsl_460+spirv_1_4 -entry main
+
+uniform RaytracingAccelerationStructure gScene;
+
+int helper(RaytracingAccelerationStructure a, int b)
+{
+ return b;
+}
+
+[shader("compute")]
+void main(
+ uniform RaytracingAccelerationStructure x)
+{
+ helper(x, 1);
+} \ No newline at end of file
diff --git a/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang.glsl b/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang.glsl
new file mode 100644
index 000000000..f95321039
--- /dev/null
+++ b/tests/pipeline/ray-tracing/acceleration-structure-in-compute.slang.glsl
@@ -0,0 +1,17 @@
+#version 460
+#extension GL_EXT_ray_tracing : require
+
+int helper_0(accelerationStructureEXT a_0, int b_0)
+{
+ return b_0;
+}
+
+layout(binding = 1)
+uniform accelerationStructureEXT entryPointParams_x_0;
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main()
+{
+ int _S1 = helper_0(entryPointParams_x_0, 1);
+ return;
+}
diff --git a/tests/pipeline/ray-tracing/trace-ray-inline.slang b/tests/pipeline/ray-tracing/trace-ray-inline.slang
index 30c32ee4f..774a392a8 100644
--- a/tests/pipeline/ray-tracing/trace-ray-inline.slang
+++ b/tests/pipeline/ray-tracing/trace-ray-inline.slang
@@ -1,7 +1,7 @@
// trace-ray-inline.slang
//TEST:CROSS_COMPILE:-target dxil-asm -stage compute -profile sm_6_5 -entry main
-//TEST:CROSS_COMPILE:-target spirv-asm -stage compute -profile sm_6_5 -entry main
+//TEST:CROSS_COMPILE:-target spirv-asm -stage compute -profile glsl_460+spirv_1_4 -entry main
// The goal of this shader is to use all the main pieces
// of functionality in DXR 1.1's `TraceRayInline` feature,
diff --git a/tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl b/tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl
index 883742020..fb94867a8 100644
--- a/tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl
+++ b/tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl
@@ -2,6 +2,7 @@
//TEST_IGNORE_FILE:
#version 460
+#extension GL_EXT_ray_tracing : require
#extension GL_EXT_ray_query : require
struct SLANG_ParameterGroup_C_0