path: root/src
diff options
authorChris Forbes <>2013-12-18 21:27:59 +1300
committerCarl Worth <>2014-01-09 12:20:23 -0800
commitc24489b0ef74a34aae440658021c7c44936a9e6f (patch)
tree212a0db58dd01621aaed6467aa02566d82d47971 /src
parent2b205f2864e14914c712aa607353e7e541cd250f (diff)
i965: fold offset into coord for textureOffset(gsampler2DRect)
The hardware is broken with nonzero texel offsets and unnormalized coordinates; instead of doing correct offsetting, we get garbage. This just extends the existing workaround for ir_txf and ir_tg4+gsampler2DRect to also consider ir_tex+gsampler2DRect. Fixes broken rendering in 'tesseract' when 'mesa_texrectoffset_bug' is not enabled; also fixes the new piglit test 'tests/spec/glsl-1.30/execution/fs-textureOffset-Rect'. Has been broken ~forever; suggesting including this in only 10.0 because the lowering pass doesn't exist in 9.2 or earlier so would require quite a different patch. Signed-off-by: Chris Forbes <> Reviewed-by: Kenneth Graunke <> Cc: Lee Salzman <> Cc: "10.0" <> (cherry picked from commit 9e99735f301ebf85f8d0bfdce2bad441a5aac7f8)
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp b/src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp
index df4fe4be463..c95d7f3cac7 100644
--- a/src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp
+++ b/src/mesa/drivers/dri/i965/brw_lower_unnormalized_offset.cpp
@@ -55,7 +55,7 @@ brw_lower_unnormalized_offset_visitor::visit_leave(ir_texture *ir)
if (!ir->offset)
return visit_continue;
- if (ir->op == ir_tg4) {
+ if (ir->op == ir_tg4 || ir->op == ir_tex) {
if (ir->sampler->type->sampler_dimensionality != GLSL_SAMPLER_DIM_RECT)
return visit_continue;