Created attachment 40532 [details] test case for arrays compare In glsl 1.20 spec, it says "The equality operators equal (==), and not equal (!=) operate on all types. For vectors, matrices, structures, and arrays, all components, fields, or elements of one operand must equal the corresponding components, fields, or elements in the other operand for the operands to be considered equal. To get a vector of component-wise equality results for vectors, use the built-in functions equal and notEqual." But I find our drivers failed to compare two arrays correctly, I tested with two vector arrays and two float arrays. I attached a piglit test case to reproduce it. I tested with: Libdrm: (master)2.4.22-16-g51b895041c65f7ec9ecda48e79279dde29258b07 Mesa: (master)3688301c59d5661d7a5f1473576f2ad1ed575a14 Xserver: (server-1.9-branch) xorg-server-1.9.2.901-4-g201273a2b97754d1f9fd672660dcc9c05af29621 Xf86_video_intel: (master)2.13.901-4-g33c08882c0d551afb28baef643279901dcc65fa9 Cairo: (master)abff335348c4f3b1c694cf44bf089d2a437937b4 Kernel: (drm-intel-fixes)da79de97d254145dcb7c08c978b1093eac15ec9c Reproduce steps: 1. xinit& 2. ./shader_runner glsl-array-compare.shader_test -auto
The output when run the test case is as following: Probe at (0,0) Expected: 1.000000 0.500000 0.500000 0.500000 Observed: 0.501961 0.501961 0.501961 0.501961 PIGLIT: {'result': 'fail' }
Created attachment 40534 [details] test case for arrays compare
with the new test case the output is: Probe at (0,0) Expected: 0.000000 1.000000 0.000000 1.000000 Observed: 1.000000 0.000000 0.000000 1.000000 PIGLIT: {'result': 'fail' }
I've commit the test case from attachment id=40543 to piglit.
this is said as fixed: Author: Eric Anholt <eric@anholt.net> Date: Tue Nov 30 11:23:28 2010 -0800 glsl: Fix structure and array comparisions. We were trying to emit a single ir_expression to compare the whole thing. The backends (ir_to_mesa.cpp and brw_fs.cpp so far) expected ir_binop_any_nequal or ir_binop_all_equal to apply to at most a vector (with matrices broken down by the lowering pass). Break them down to a bunch of ORed or ANDed any_nequals/all_equals. Fixes: glsl-array-compare glsl-array-compare-02 glsl-fs-struct-equal glsl-fs-struct-notequal Bug #31909
(In reply to comment #5) > this is said as fixed: > Author: Eric Anholt <eric@anholt.net> > Date: Tue Nov 30 11:23:28 2010 -0800 > glsl: Fix structure and array comparisions. > We were trying to emit a single ir_expression to compare the whole > thing. The backends (ir_to_mesa.cpp and brw_fs.cpp so far) expected > ir_binop_any_nequal or ir_binop_all_equal to apply to at most a vector > (with matrices broken down by the lowering pass). Break them down to > a bunch of ORed or ANDed any_nequals/all_equals. > Fixes: > glsl-array-compare > glsl-array-compare-02 > glsl-fs-struct-equal > glsl-fs-struct-notequal > Bug #31909 Yes. It pass now with newest commit in mesa master branch. verified. Mesa: (master)2bb788ccc674669bc03ad09e4396f079044112e8
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.