SPIRV-Cross/shaders/vert/row-major-workaround.vert
Hans-Kristian Arntzen 03b1f66ef1 GLSL: Fix row-major workaround wrapper for ES.
By default, the matrix would be declared as mediump, causing precision
issues. Need to dispatch to two separate functions since GLSL does not
support overload based on precision.
2022-12-13 15:44:03 +01:00

29 lines
491 B
GLSL

#version 310 es
layout(binding = 0) uniform Buffer
{
layout(row_major) highp mat4 HP;
layout(row_major) mediump mat4 MP;
};
layout(binding = 1) uniform Buffer2
{
layout(row_major) mediump mat4 MP2;
};
layout(location = 0) in vec4 Hin;
layout(location = 1) in mediump vec4 Min;
layout(location = 0) out vec4 H;
layout(location = 1) out mediump vec4 M;
layout(location = 2) out mediump vec4 M2;
void main()
{
gl_Position = vec4(1.0);
H = HP * Hin;
M = MP * Min;
M2 = MP2 * Min;
}