yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

CopilotFix compiler crash when enum is used as vertex output data (#7915)528ca0d0e

master
584 B28 linesraw
1//TEST:SIMPLE(filecheck=CHECK):-target hlsl -stage vertex -entry main
2
3public enum VertexLayout : uint {
4    position = 0,
5    color = 1,
6    uv = 2
7}
8
9struct VertexInput {
10    float3 position : POSITION_ATTR;
11    uint color      : COLOR_ATTR;
12    float2 uv       : UV_ATTR;
13};
14
15public struct VertexOutput {
16    float4 position     : SV_Position;
17    VertexLayout layout : TEXCOORD0;
18}
19
20[shader("vertex")]
21VertexOutput main(in VertexInput input) {
22    VertexOutput output;
23    output.position = float4(0);
24    output.layout = VertexLayout.position;
25    return output;
26}
27
28//CHECK: main