This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GLSL ES 3 mix function bad overload.

Running the r3p0 drivers I've hit an issue that no other video drivers(Qualcomm, Mesa, Nvidia, fglrx) seem to hit.

Running a very simple fragment shader as an example.

void main()
{
  ivec2 uv = ivec2(gl_FragCoord.xy);
  ivec2 ts = textureSize(samp9, 0);
  vec4 c0 = texelFetch(samp9, ivec2(uv.x / 2, ts.y - uv.y - 1), 0);
  float y = mix(c0.b, c0.r, uv.x & 1);
  float yComp = 1.164 * (y - 0.0625);
  float uComp = c0.g - 0.5;
  float vComp = c0.a - 0.5;
  ocol0 = vec4(yComp + (1.596 * vComp),
  yComp - (0.813 * vComp) - (0.391 * uComp),
  yComp + (2.018 * uComp),
  1.0); 
}

I'm having an issue with the mix function on line six. Basically the shader compiler doesn't realize that uv.x & 1 will be a boolean result and fails out.

A simple remedy to the issue is wrapping it like "(uv.x & 1) != 0" but in this case it really shouldn't be necessary.

Hope you guys fix the issue.

Parents
  • Reasonable response, I've already worked around the shader compiler being overly strict in other places.

    Overly strict being what the spec is supposed to be, but being slightly more lenient is what everyone else does (except Qualcomm because they are just broken).

Reply
  • Reasonable response, I've already worked around the shader compiler being overly strict in other places.

    Overly strict being what the spec is supposed to be, but being slightly more lenient is what everyone else does (except Qualcomm because they are just broken).

Children
No data