i965: Rewrite ir_tex to ir_txl with lod 0 for vertex shaders
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 14 Apr 2015 15:02:18 +0000 (15:02 +0000)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 16 Apr 2015 16:18:30 +0000 (09:18 -0700)
commit993a6288f72fa98932df7cdb6f64d9dd645e670d
treee24cb90717fb8d31ab5c54858b85d5721641b74d
parenta7d018accfd0161510a75ba685e056256de494c2
i965: Rewrite ir_tex to ir_txl with lod 0 for vertex shaders

The ir_tex opcode turns into a sample or sample_c message, which will try to
compute derivatives to determine the lod. This produces garbage for
non-fragment shaders where the sample coordinates don't correspond to
subspans.

We fix this by rewriting the opcode from ir_tex to ir_txl and setting the
lod to 0.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89457
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg <kristian.h.kristensen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp