OSDN Git Service

i965/fs: Fix conversions float->bool, int->bool
authorChad Versace <chad.versace@linux.intel.com>
Thu, 21 Jun 2012 18:35:03 +0000 (11:35 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Mon, 25 Jun 2012 22:56:40 +0000 (15:56 -0700)
commitcf0bbb30f6bd9d3fa61b5207320e8f34c563a2c6
treea1fcc86fa303d56be342a614a3501f4b95be287a
parent345ee593e91e14173cbc08a647b008855b7638ca
i965/fs: Fix conversions float->bool, int->bool

Fixes gles2conform GL.equal.equal_bvec2_frag.

This fixes brw_fs_visitor's translation of ir_unop_f2b.  It used CMP to
convert the float to one of 0 or ~0. However, the convention in the
compiler is that true is represented by 1, not ~0. This patch adds an AND
to convert ~0 to 1.

By inspection, a similar problem existed with ir_unop_i2b, with a similar
fix.

[v2 kayden]: eliminate extra temporary register.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49621
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp