summaryrefslogtreecommitdiffstats
path: root/tests/pipeline
diff options
context:
space:
mode:
authorCopilot <198982749+Copilot@users.noreply.github.com>2025-07-31 15:49:39 -0700
committerGitHub <noreply@github.com>2025-07-31 22:49:39 +0000
commite313300d2446c2efdc1d221304a6b6454fe7fa54 (patch)
tree5212b5527f42eaf8e5dc68add8373a58d96b3392 /tests/pipeline
parent30fd3c63fb4af9ea8d482c75921710df1b40e59e (diff)
Fix segmentation fault in ray tracing parameter consolidation. (#7997)
* Initial plan * Fix segfault in ray tracing parameter consolidation Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Fix. * Fix. * Keep entrypoint param layout consistent during `MoveEntryPointUniformParametersToGlobalScope`. * Fix. * fix. * Fix. * Fix pending layout handling. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/pipeline')
-rw-r--r--tests/pipeline/ray-tracing/ray-tracing-paramblock-regression.slang43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/pipeline/ray-tracing/ray-tracing-paramblock-regression.slang b/tests/pipeline/ray-tracing/ray-tracing-paramblock-regression.slang
new file mode 100644
index 000000000..657618ce3
--- /dev/null
+++ b/tests/pipeline/ray-tracing/ray-tracing-paramblock-regression.slang
@@ -0,0 +1,43 @@
+// ray-tracing-paramblock-regression.slang
+
+// Regression test for fix to segfault when using ParameterBlock with generics
+// in ray tracing shaders
+
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+interface IMatData {}
+
+struct PerDrawSubmesh<T> where T : IMatData
+{
+ T* p_mat_data;
+}
+
+struct RtUbo<T> where T : IMatData
+{
+ PerDrawSubmesh<T>* p_per_dsm_buff;
+}
+
+struct RtPayload
+{
+ float3 emission = float3(0);
+}
+
+struct RtParams<T> where T : IMatData
+{
+ RtUbo<T> ubo;
+};
+
+struct MatData : IMatData
+{
+ float4 emission;
+}
+
+// This used to cause a segfault before the fix
+[shader("closesthit")]
+void chit_main_with_paramblock(uniform ParameterBlock<RtParams<MatData>> params, in BuiltInTriangleIntersectionAttributes attr, out RtPayload payload)
+{
+ payload = {};
+ payload.emission = float3(1, 0, 0);
+}
+
+// CHECK: OpEntryPoint \ No newline at end of file