summaryrefslogtreecommitdiff
path: root/tests/spirv/device-index-glsl-syntax.slang
blob: 3a374f0384619a2eb6635f6609318cf7322511fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry main -stage fragment -allow-glsl
//TEST:SIMPLE(filecheck=GLSL): -target glsl -entry main -stage fragment -allow-glsl

// SPIRV: OpDecorate %{{.*}} BuiltIn DeviceIndex
// GLSL: gl_DeviceIndex

struct PSIn
{
    float3 color;
}

[shader("fragment")]
float4 main(PSIn pin)
{
    return float4(pin.color, (float)gl_DeviceIndex);
}