From 96df31a9fa53e3d897a2b7c4eef021f37f421c91 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Mon, 13 Oct 2025 23:14:45 +0900 Subject: Fix segfault on arrays of structs containing parameter blocks (#8555) Closes https://github.com/shader-slang/slang/issues/8154 However there is further design work to do on implementing the "NonAddressableType" suggestion --- tests/diagnostics/array-parameterblock-struct.slang | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/diagnostics/array-parameterblock-struct.slang (limited to 'tests/diagnostics/array-parameterblock-struct.slang') diff --git a/tests/diagnostics/array-parameterblock-struct.slang b/tests/diagnostics/array-parameterblock-struct.slang new file mode 100644 index 000000000..5723ce709 --- /dev/null +++ b/tests/diagnostics/array-parameterblock-struct.slang @@ -0,0 +1,21 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): + +// Test: Array of struct containing ParameterBlock - should error + +struct StructWithParameterBlock +{ + ParameterBlock pb; + int other; +} + +RWStructuredBuffer outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + // Force usage of the array to prevent optimization + outputBuffer[dispatchThreadID.x] = arrayOfStructWithPB[dispatchThreadID.x % 3].pb; +} + +//CHECK: ([[# @LINE+1]]): error 30027 +uniform StructWithParameterBlock arrayOfStructWithPB[3]; \ No newline at end of file -- cgit v1.2.3