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

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

struct PSIn
{
    float3 color;
    int deviceIndex : SV_DeviceIndex;
}

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