blob: 9df3168a407db8d41d51e1d58624abe2e985d325 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
//TEST:SIMPLE(filecheck=CHECK): -target spirv
// ViewIndex builtin should be declared twice, once for vertex and once for fragment shader.
// Because the fragment shader builtin needs Flat, and vertex shader does not.
// CHECK: OpDecorate %{{.*}} BuiltIn ViewIndex
// CHECK: OpDecorate %{{.*}} BuiltIn ViewIndex
[shader("vertex")]
float4 vert(int _viewportIndex : SV_ViewID):SV_Position
{
return float4(_viewportIndex);
}
[shader("fragment")]
float4 frag(int _viewportIndex : SV_ViewID) : SV_Target
{
return float4(_viewportIndex, 0, 0, 1);
}
|