Created attachment 42941 [details] [review]
Fix for bug.
In GLSL < 1.30, operators % and %= are reserved, but the compiler accepts them anyway.
Attached is a fix for the bug.
Should this bug be fixed? Fixing it may break applications that rely on this "feature".
For operator %, see section 5.9 of the GLSL ES 1.00, GLSL 1.10, and GLSL 1.20 spec. For operator %=, see section 5.8 of the GLSL ES 1.00, GLSL 1.10, and GLSL 1.20 spec.
We should definitely fix this. We don't want to encourage apps to assume that out-of-spec code will work.
I think the version check should be done in modulus_result_type. This matches the way other 1.30 operators (e.g., the bit-wise operators) are handled.
Ian, I followed your advice and placed the code in modulus_result_type().
Fixed by the following commit:
Author: Chad Versace <firstname.lastname@example.org>
Date: Fri Feb 4 12:18:56 2011 -0800
glsl: Set operators '%' and '%=' to be reserved when GLSL < 1.30
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.