Mesa (master): i965: Drop ir->op != ir_txf condition in offset checking.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Oct 16 00:02:49 UTC 2014


Module: Mesa
Branch: master
Commit: cee2027574579d63cdf9693156542e7862b27131
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cee2027574579d63cdf9693156542e7862b27131

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Sep  1 01:39:14 2014 -0700

i965: Drop ir->op != ir_txf condition in offset checking.

brw_lower_unnormalized_offset sets ir->offset to NULL if it applies the
texelFetchOffset workarounds, so there's no need to special case it
here---there won't be an offset for ir_txf.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>

---

 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp   |    5 ++---
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 52771e9..163d642 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -1492,8 +1492,7 @@ fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst, fs_reg coordinate,
    }
    int length = 0;
 
-   if (ir->op == ir_tg4 || (ir->offset && ir->op != ir_txf) ||
-       is_high_sampler(brw, sampler)) {
+   if (ir->op == ir_tg4 || ir->offset || is_high_sampler(brw, sampler)) {
       /* For general texture offsets (no txf workaround), we need a header to
        * put them in.  Note that for SIMD16 we're making space for two actual
        * hardware registers here, so the emit will have to fix up for this.
@@ -1989,7 +1988,7 @@ fs_visitor::visit(ir_texture *ir)
                                lod, lod2, sampler);
    }
 
-   if (ir->offset != NULL && ir->op != ir_txf)
+   if (ir->offset != NULL)
       inst->texture_offset = brw_texture_offset(ctx, ir->offset->as_constant());
 
    if (ir->op == ir_tg4)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index ef923dd..88ec79e 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2552,7 +2552,7 @@ vec4_visitor::visit(ir_texture *ir)
 
    vec4_instruction *inst = new(mem_ctx) vec4_instruction(this, opcode);
 
-   if (ir->offset != NULL && ir->op != ir_txf)
+   if (ir->offset != NULL)
       inst->texture_offset = brw_texture_offset(ctx, ir->offset->as_constant());
 
    /* Stuff the channel select bits in the top of the texture offset */




More information about the mesa-commit mailing list