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