i965/fs: Make gather_channel() not use ir_texture.
authorConnor Abbott <connor.abbott@intel.com>
Sat, 2 Aug 2014 01:08:08 +0000 (18:08 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 16 Oct 2014 00:05:20 +0000 (17:05 -0700)
Our new IR won't have ir_texture objects.

Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 6c99d22817b05977e02fc3ad5507c57ac8763ae2..dc4e0c8c93306a4e7239ad4efe4153d21661f5d4 100644 (file)
@@ -334,7 +334,7 @@ public:
    void visit(ir_emit_vertex *);
    void visit(ir_end_primitive *);
 
-   uint32_t gather_channel(ir_texture *ir, uint32_t sampler);
+   uint32_t gather_channel(int orig_chan, uint32_t sampler);
    void swizzle_result(ir_texture_opcode op, int dest_components,
                        fs_reg orig_val, uint32_t sampler);
 
index 5c0b0b93f06f01e2cee3d610708845437b22a1cc..9008e167df10264dd17119ce88d411ef4fe38b3e 100644 (file)
@@ -2024,7 +2024,7 @@ fs_visitor::visit(ir_texture *ir)
       inst->texture_offset = offset_value.fixed_hw_reg.dw1.ud;
 
    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
 
    if (ir->shadow_comparitor)
       inst->shadow_compare = true;
@@ -2092,14 +2092,13 @@ 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, uint32_t sampler)
+fs_visitor::gather_channel(int orig_chan, uint32_t sampler)
 {
    const struct brw_sampler_prog_key_data *tex =
       (stage == MESA_SHADER_FRAGMENT) ?
       &((brw_wm_prog_key*) this->key)->tex : NULL;
    assert(tex);
-   ir_constant *chan = ir->lod_info.component->as_constant();
-   int swiz = GET_SWZ(tex->swizzles[sampler], chan->value.i[0]);
+   int swiz = GET_SWZ(tex->swizzles[sampler], orig_chan);
    switch (swiz) {
       case SWIZZLE_X: return 0;
       case SWIZZLE_Y: