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 --- .../structuredbuffer-with-unbounded.slang | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/diagnostics/structuredbuffer-with-unbounded.slang (limited to 'tests/diagnostics/structuredbuffer-with-unbounded.slang') diff --git a/tests/diagnostics/structuredbuffer-with-unbounded.slang b/tests/diagnostics/structuredbuffer-with-unbounded.slang new file mode 100644 index 000000000..7c2a3bd47 --- /dev/null +++ b/tests/diagnostics/structuredbuffer-with-unbounded.slang @@ -0,0 +1,20 @@ +// Test that StructuredBuffer of struct with unbounded array is not allowed + +//TEST:SIMPLE(filecheck=CHECK): -target spirv -allow-glsl -stage compute -entry computeMain + +// Struct containing unbounded array (must be last member) +struct StructWithUnbounded +{ + float value; + int data[]; // Unbounded array must be last member +} + +// StructuredBuffer of struct with unbounded array - should error +//CHECK: ([[# @LINE+1]]): error 30028 +StructuredBuffer myBuffer; + +[numthreads(1, 1, 1)] +void computeMain() +{ + // Empty - we're just testing the declarations +} \ No newline at end of file -- cgit v1.2.3