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

public enum VertexLayout : uint {
    position = 0,
    color = 1,
    uv = 2
}

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: main