yum-mirror/slang

Making it easier to work with shaders

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

Yong HeAdd SV_DrawIndex. (#5787)ebfbe5886

master
470 B18 linesraw
1//TEST:SIMPLE(filecheck=SPIRV): -target spirv
2//TEST:SIMPLE(filecheck=SPIRV): -target spirv -entry vsMain -stage vertex -emit-spirv-via-glsl
3//TEST:SIMPLE(filecheck=GLSL): -target glsl -entry vsMain -stage vertex
4
5// SPIRV: OpDecorate %{{.*}} BuiltIn DrawIndex
6// GLSL: gl_DrawID
7
8struct VertexIn
9{
10    float3 position;
11    int drawIndex : SV_DrawIndex;
12}
13
14[shader("vertex")]
15float4 vsMain(VertexIn vin) : SV_Position
16{
17    return float4(vin.position, vin.drawIndex);
18}