summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/array-parameterblock-array-in-struct.slang
blob: 832c90925040f22d712499dbb44cdd5d3f71b97d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Test that structs containing arrays of ParameterBlocks are also NonAddressable
// and therefore cannot be used in arrays

//TEST:SIMPLE(filecheck=CHECK): -target spirv -allow-glsl -stage compute -entry computeMain
//TEST_DISABLED:SIMPLE(filecheck=CHECK): -target glsl -allow-glsl -stage compute -entry computeMain  

// Test case: struct containing array of ParameterBlock
struct StructWithParameterBlockArray
{
    ParameterBlock<Texture2D> blocks[2];  // Array of ParameterBlocks
    int value;
}

// This should trigger error 30027 - arrays of NonAddressable types are not allowed
//CHECK: ([[# @LINE+1]]): error 30027
StructWithParameterBlockArray myArray[3];  // Array of struct containing ParameterBlock array

[numthreads(1, 1, 1)]
void computeMain()
{
    // Empty - we're just testing the declaration
}