zink: RAGE renders with red filter
This is caused by the shader
#version 330
uniform sampler2D tex;
in vec2 texCoord;
uniform ramp {
float values[3 * 256];
};
layout(location = 0) out vec4 outColor;
void main(void)
{
vec4 lookup = texture(tex, texCoord) * 255.0;
outColor.r = values[ int(lookup.r)];
outColor.g = values[256 + int(lookup.g)];
outColor.b = values[256 * 2 + int(lookup.b)];
outColor.a = 1.0;
}
deciding that it should randomly multiply the ubo load offsets by 4.
zink has no other cases I'm aware of where ubo loading is broken like this, and there's no way I've been able to figure out to fix it with the current infrastructure.
Trace attached.
https://gitlab.freedesktop.org/zmike/dumps/-/blob/master/rage.trace