SPIRV-Cross/shaders-msl/frag/fragment-component-padding.pad-fragment.frag
Hans-Kristian Arntzen b8033d7525 MSL: Add option to pad fragment outputs.
If not enough components are provided in the shader,
the shader MSL compiler throws an error rather than make components
undefined. This hurts portability, so we need to add explicit padding
here.
2019-01-14 15:11:52 +01:00

19 lines
342 B
GLSL

#version 450
layout(location = 0) out float FragColors[2];
layout(location = 2) out vec2 FragColor2;
layout(location = 3) out vec3 FragColor3;
layout(location = 0) in vec3 vColor;
void set_globals()
{
FragColors[0] = vColor.x;
FragColors[1] = vColor.y;
FragColor2 = vColor.xz;
FragColor3 = vColor.zzz;
}
void main()
{
set_globals();
}