vtn: mediump_16bit_alu and compatibility
I have a test that draws a triangle with
#version 320 es
precision highp float;
layout(location = 0) in vec3 in_color;
layout(location = 0) out vec4 out_color;
void main()
{
mediump float a = in_color.x;
mediump float b = min(a, 1.0);
out_color = a == b ? vec4(1.0) : vec4(0.0);
}
The colors at the vertices of the triangle are red, green, and blue.
Before commit a28d2e87, it draws a white triangle. After the commit, it draws a triangle that is mostly black, because b
goes through f2f16
and f2f32
and loses precision.
Is this a bug of the test, glslangValidator (which I use to convert to spir-v), or that mediump_16bit_alu
only applies to ALUs?