summaryrefslogtreecommitdiffstats
path: root/tests/bugs/enum-vertex-output.slang
blob: ad04f1163c59a272bbec629984a49e70c2606a51 (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
28
29
//TEST:SIMPLE(filecheck=CHECK):-target hlsl -stage vertex -entry main

[Flags]
public enum VertexLayout : uint {
    position,
    color,
    uv
}

struct VertexInput {
    float3 position : POSITION_ATTR;
    uint color      : COLOR_ATTR;
    float2 uv       : UV_ATTR;
};

public struct VertexOutput {
    float4 position     : SV_Position;
    VertexLayout layout : TEXCOORD0;
}

[shader("vertex")]
VertexOutput main(in VertexInput input) {
    VertexOutput output;
    output.position = float4(0);
    output.layout = VertexLayout.position;
    return output;
}

//CHECK: layout_0 : TEXCOORD0