yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie HermaszewskaFix segfault on arrays of structs containing parameter blocks (#8555)96df31a9f

master
814 B22 linesraw
1// Test that structs containing arrays of ParameterBlocks are also NonAddressable
2// and therefore cannot be used in arrays
3
4//TEST:SIMPLE(filecheck=CHECK): -target spirv -allow-glsl -stage compute -entry computeMain
5//TEST_DISABLED:SIMPLE(filecheck=CHECK): -target glsl -allow-glsl -stage compute -entry computeMain  
6
7// Test case: struct containing array of ParameterBlock
8struct StructWithParameterBlockArray
9{
10    ParameterBlock<Texture2D> blocks[2];  // Array of ParameterBlocks
11    int value;
12}
13
14// This should trigger error 30027 - arrays of NonAddressable types are not allowed
15//CHECK: ([[# @LINE+1]]): error 30027
16StructWithParameterBlockArray myArray[3];  // Array of struct containing ParameterBlock array
17
18[numthreads(1, 1, 1)]
19void computeMain()
20{
21    // Empty - we're just testing the declaration
22}