[Mesa-dev] [PATCH 11/13] i965/fs: make gather_channel() more generic

Connor Abbott cwabbott0 at gmail.com
Mon Aug 4 14:28:15 PDT 2014


Signed-off-by: Connor Abbott <connor.abbott at intel.com>
---
 src/mesa/drivers/dri/i965/brw_fs.h           | 2 +-
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index d3c2e5f..b0f26a5 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -241,7 +241,7 @@ public:
    void visit(ir_emit_vertex *);
    void visit(ir_end_primitive *);
 
-   uint32_t gather_channel(ir_texture *ir, int sampler);
+   uint32_t gather_channel(int orig_chan, int sampler);
    void swizzle_result(ir_texture_opcode op, int dest_components,
                        fs_reg orig_val, int sampler);
 
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 16afd28..8020470 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -1957,10 +1957,9 @@ fs_visitor::emit_gen6_gather_wa(uint8_t wa, fs_reg dst)
  * Set up the gather channel based on the swizzle, for gather4.
  */
 uint32_t
-fs_visitor::gather_channel(ir_texture *ir, int sampler)
+fs_visitor::gather_channel(int orig_chan, int sampler)
 {
-   ir_constant *chan = ir->lod_info.component->as_constant();
-   int swiz = GET_SWZ(key->tex.swizzles[sampler], chan->value.i[0]);
+   int swiz = GET_SWZ(key->tex.swizzles[sampler], orig_chan);
    switch (swiz) {
       case SWIZZLE_X: return 0;
       case SWIZZLE_Y:
-- 
1.9.3



More information about the mesa-dev mailing list