[Public WebGL] Conformance test for GLSL: Side-effects in the ternary if operator (used in combination with the comma (sequence) operator)

Rehno Lindeque [email protected]
Fri Feb 10 11:24:01 PST 2012

Hi all,

Following a lively discussion at the San Francisco WebGL meetup last night,
someone suggested that we should submit bugs in GLSL so they could be added
to the WebGL conformance tests. I agree that getting consistent glsl
support across all devices/drivers would be pretty helpful.

This is a bug that I've found in ANGLE on windows machines running Google
Chrome 16.0.912.77 m.

float a = ...
float b = ...
float r0 = ...
float r1 = ...
float r = ...
float ab = a > b? (r = r0, a) : (r = r1, b);
return r;

On my usual (linux) machine this runs only one of the two side-effects (r =
r0) or (r = r1) as you'd expect, but on ANGLE I believe it probably runs

I didn't submit this before because I haven't had time to write up a decent
test, however if someone would be willing to add it I'd be grateful. I
guess I could probably be convinced to generate a shader that fails at this
if you really need it.

Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20120210/f1a961a8/attachment.html>

More information about the public_webgl mailing list