Below shader failed on Calpella (i965) with mesa master: Probe at (0,0) Expected: 0.500000 0.500000 0.500000 0.500000 Observed: 0.501961 0.501961 0.000000 1.000000 PIGLIT: {'result': 'fail' } [require] GL >= 2.0 GLSL >= 1.10 [fragment shader] void main(void) { mat2 m = mat2(0.5, 0.5, 0.5, 0.5); m[0][0] = m[0][0] + 0.3; m[0][0] = m[0][0] - 0.3; gl_FragColor = vec4(m[0][0], m[0][1], m[1][0], m[1][1]); } [test] draw rect -1 -1 2 2 probe all rgba 0.5 0.5 0.5 0.5
Created attachment 40659 [details] matrix_operation.shader_test
Created attachment 40660 [details] matrix_operation.shader_test sorry, typo in previous attachment. Please use this one.
I was only able to reproduce this using the i965 driver. swrast and i915 do not exhibit this failure.
increasing priority, as this impacts many matrix tests.
I debugged this a bit more. It looks like fs_visitor::visit(ir_constant *ir) in brw_fs.cpp isn't handling matrices, arrays, or structures correctly. Hacking this up to handle matrices fixes this bug, but this particular problem may affect other tests. I'll come up with a full fix soon.
I added piglit tests glsl-const-initializer-0[123] to reproduce this set of errors.
We could use a better for the structure case. Right now the structures get split out, and the new code in brw_fs.cpp is never executed. commit 6848e27e1462e98dd91826a06f96c203c9eeebd0 Author: Ian Romanick <ian.d.romanick@intel.com> Date: Tue Dec 7 14:50:34 2010 -0800 i965: Correctly emit constants for aggregate types (array, matrix, struct) Previously the code only handled scalars and vectors. This new code is modeled somewhat after similar code in ir_to_mesa. Reviewed-by: Eric Anholt <eric@anholt.net>
*** Bug 32201 has been marked as a duplicate of this bug. ***
verified
*** Bug 30915 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.