diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2021-03-16 15:27:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-16 15:27:34 -0700 |
| commit | b64a23cccfe9876d53cda773afc796bd975fa7e5 (patch) | |
| tree | f4533f6d24f6a9cb7cb503b5426b0ab1196128f5 /tests | |
| parent | 210a9889ae35ac61a7f33a758e08fb51d46395e7 (diff) | |
Fix the "acceleration structure in compute" bug for GL_NV_ray_tracing too (#1759)
A recent change broke code that uses `RayTracingAccelerationStructure` in non-RT shader stages for Vulkan/GLSL when also *not* doing any ray tracing in the shader code.
A recent fix patched that up for code using `GL_EXT_ray_tracing` and/or `GL_EXT_ray_query`, but that fix didn't apply on the path that uses `GL_NV_ray_tracing` via an opt-in.
This change fixes that gap and checks in a test for it.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang | 20 | ||||
| -rw-r--r-- | tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang.glsl | 18 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang b/tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang new file mode 100644 index 000000000..2a9d32ffa --- /dev/null +++ b/tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.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+GL_NV_ray_tracing -entry main -DUSE_NV_EXT=1 + +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-nv.slang.glsl b/tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang.glsl new file mode 100644 index 000000000..5819d657d --- /dev/null +++ b/tests/pipeline/ray-tracing/acceleration-structure-in-compute-nv.slang.glsl @@ -0,0 +1,18 @@ +#version 460 + +#extension GL_NV_ray_tracing : require + +int helper_0(accelerationStructureNV a_0, int b_0) +{ + return b_0; +} + +layout(binding = 1) +uniform accelerationStructureNV 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; +} |
