0e9ad14ba6
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.
11 lines
179 B
GLSL
11 lines
179 B
GLSL
#version 450
|
|
#extension GL_ARB_shader_viewport_layer_array : require
|
|
|
|
layout(location = 0) in vec4 coord;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = coord;
|
|
gl_ViewportIndex = int(coord.z);
|
|
}
|