v2: fix build failure Signed-off-by: Connor Abbott <connor.abb...@intel.com> --- src/mesa/drivers/dri/i965/brw_fs.h | 2 +- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 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 3521064..50f4106 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -1885,7 +1885,7 @@ fs_visitor::visit(ir_texture *ir) ir->offset->type->vector_elements); if (ir->op == ir_tg4) - inst->texture_offset |= gather_channel(ir, sampler) << 16; // M0.2:16-17 + inst->texture_offset |= gather_channel(ir->lod_info.component->as_constant()->value.i[0], sampler) << 16; // M0.2:16-17 inst->sampler = sampler; @@ -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 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev