SPIRV-Cross/shaders-msl/vert/layer.msl11.invalid.vert
Chip Davis 0e9ad14ba6 MSL: Handle the ViewportIndex builtin.
This requires MSL 2.0+.

Also, force `ViewportIndex` and `Layer` to be defined as the correct
type, which is always `uint` in MSL.

Since Metal doesn't yet have geometry shaders, the vertex shader (or
tessellation evaluation shader == "post-tessellation vertex shader" in
Metal jargon) is the only kind of shader that can set this output. This
currently requires an extension to Vulkan, which causes validation of
the SPIR-V binaries for the test cases to fail. Therefore, the test
cases are marked "invalid", even though they're actually perfectly valid
SPIR-V--they just won't work without the
`SPV_EXT_shader_viewport_index_layer` extension.
2018-09-18 09:52:30 -05:00

11 lines
171 B
GLSL

#version 450
#extension GL_ARB_shader_viewport_layer_array : require
layout(location = 0) in vec4 coord;
void main()
{
gl_Position = coord;
gl_Layer = int(coord.z);
}