SPIRV-Cross/shaders-msl/frag/vecsize-mismatch.shader-inputs.frag
Chip Davis 5281d9997e MSL: Fix up input variables' vector lengths in all stages.
Metal is picky about interface matching. If the types don't match
exactly, down to the number of vector components, Metal fails pipline
compilation. To support pipelines where the number of components
consumed by the fragment shader is less than that produced by the vertex
shader, we have to fix up the fragment shader to accept all the
components produced.
2020-06-16 14:50:30 -05:00

18 lines
401 B
GLSL

#version 450
#extension GL_AMD_gpu_shader_int16 : require
layout(location = 0) flat in int16_t a;
layout(location = 1) flat in ivec2 b;
layout(location = 2) flat in uint16_t c[2];
layout(location = 4) flat in uvec4 e[2];
layout(location = 6) in vec2 d;
layout(location = 0) out vec4 FragColor;
void main()
{
FragColor = vec4(float(int(a)), float(b.x), vec2(uint(c[1]), float(e[0].w)) + d);
}