summaryrefslogtreecommitdiffstats
path: root/tests/spirv/flat.slang
blob: 660f612162b264a8a872c580b93a74b8fc59918c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//TEST:SIMPLE(filecheck=CHECK): -target spirv

// Check that we don't emit duplicate Flat decorations for the same variable.

// CHECK: OpDecorate %vo_a Flat
// CHECK-NOT: OpDecorate %vo_a Flat

struct VertexOutput
{
    nointerpolation int a : SOME_VALUE;
    float4              b : SV_Position;
};

[shader("vertex")]
VertexOutput Vertex()
{
    VertexOutput out;
    out.a = 0;
    out.b = float4(0, 0, 0, 1);
    return out;
}

[shader("fragment")]
float4 Fragment(in VertexOutput vo)
{
    return float4(float(vo.a), 0, 0, 1);
}