swrast/glsl: Mod function returns wrong value
Submitted by Karthik Hariharakrishnan
Assigned to mes..@..op.org
Description
The following shader returns incorrect output. It looks like the GLSL Compiler doesnt implement mod correctly.
varying vec var1; void main (void) { gl_FragColor = vec4(mod(4.0, 2.0), 0.0, 0.0, 1.0); }
It should be the same as,
varying vec var1; void main (void) { float var = 4.0 - (2.0 * (floor(4.0/2.0)) ); //According to spec gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); }
Version: 7.6