yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
96df31a9f
master
1// Test that arrays and StructuredBuffers of nested structs with unbounded arrays are not allowed 2 3//TEST:SIMPLE(filecheck=CHECK): -target spirv -allow-glsl -stage compute -entry computeMain 4 5// Struct containing unbounded array (must be last member) 6struct StructWithUnbounded 7{ 8 float value; 9 int data[]; // Unbounded array must be last member 10} 11 12// Nested case 13struct NestedUnbounded 14{ 15 int id; 16 StructWithUnbounded nested; // Struct with unbounded array member 17} 18 19// Array of nested struct - should error 20//CHECK: ([[# @LINE+1]]): error 30027 21NestedUnbounded nestedArray[5]; 22 23// StructuredBuffer of nested struct - should error 24//CHECK: ([[# @LINE+1]]): error 30028 25StructuredBuffer<NestedUnbounded> nestedBuffer; 26 27[numthreads(1, 1, 1)] 28void computeMain() 29{ 30 // Empty - we're just testing the declarations 31}