yum-mirror/slang

Making it easier to work with shaders

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

Gangzheng TongGet real value for typeAdapter (#6762)17d1a2c8c

master
497 B16 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target spirv
2
3//CHECK: OpEntryPoint
4
5// SV_VertexID is a int in the system binding semantic.
6// However, declare it as uint should also work with
7// the typeAdapter mechanism in Slang compiler.
8in uint gl_VertexIndex : SV_VertexID;
9
10static const float2 uvs[] = { float2(0.0, 0.0), float2(0.0, 2.0), float2(2.0, 0.0) };
11
12[shader("vertex")]
13float4 vert_main() : SV_Position{
14    const float2 uv = uvs[gl_VertexIndex];
15    return float4((uv * 2.0 - 1.0), 0.0, 1.0);
16}