ValhallaTeam / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Preprocessor: implement short-circuiting for && and || operators. #347

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
GLSL ES spec has this to say about && and || operators:

<snip>
- The 2nd operand in a logical and ('&&') operation is evaluated if and only if 
the 1st operand evaluates to non-zero.

- The 2nd operand in a logical or ('||') operation is evaluated if and only if 
the 1st operand evaluates to zero.

If an operand is not evaluated, the presence of undefined identifiers in the 
operand will not cause an error.
</snip>

If the operand is not evaluated, division/modulo by zero will also not cause an 
error.

Original issue reported on code.google.com by alokp@chromium.org on 13 Jul 2012 at 5:43

GoogleCodeExporter commented 9 years ago
Alok: Is this still an issue in the new preprocessor?

Original comment by dan...@transgaming.com on 26 Oct 2012 at 7:36

GoogleCodeExporter commented 9 years ago
Yes. Still an issue.

Original comment by alokp@chromium.org on 26 Oct 2012 at 7:46

GoogleCodeExporter commented 9 years ago
Take this bug.  This workaround is needed for WebGL conformance 1.0.2 in MacOSX.

Original comment by z...@google.com on 2 Oct 2013 at 8:44

GoogleCodeExporter commented 9 years ago
This bug is specific to preprocessor expressions, not source expressions.

Original comment by alokp@chromium.org on 2 Oct 2013 at 8:46

GoogleCodeExporter commented 9 years ago
alokp pointed out this bug is for preprocessor.  I will create another bug for 
compile option to work around driver bug in short-circuiting operators.

Original comment by z...@google.com on 2 Oct 2013 at 9:20

GoogleCodeExporter commented 9 years ago
I'll take this. Not high priority right now but I can take care of it as part 
of the ES3 preprocessor changes (like Issue 524).

Original comment by c...@chromium.org on 2 Jul 2014 at 8:07