gallium/ttn: minor cleanup
authorRob Clark <robclark@freedesktop.org>
Wed, 8 Apr 2015 17:17:30 +0000 (13:17 -0400)
committerRob Clark <robclark@freedesktop.org>
Sat, 11 Apr 2015 14:24:50 +0000 (10:24 -0400)
Extract tgsi_dst->Index into a local.. split out from 'gallium/ttn: add
support for temp arrays' for noise reduction..

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/auxiliary/nir/tgsi_to_nir.c

index da935a4130fda07f64d1a484fa504812adfb3eaf..fcccdad6f003758878f3e428ff00223dac17e49c 100644 (file)
@@ -340,17 +340,18 @@ ttn_get_dest(struct ttn_compile *c, struct tgsi_full_dst_register *tgsi_fdst)
 {
    struct tgsi_dst_register *tgsi_dst = &tgsi_fdst->Register;
    nir_alu_dest dest;
+   unsigned index = tgsi_dst->Index;
 
    memset(&dest, 0, sizeof(dest));
 
    if (tgsi_dst->File == TGSI_FILE_TEMPORARY) {
-      dest.dest.reg.reg = c->temp_regs[tgsi_dst->Index].reg;
-      dest.dest.reg.base_offset = c->temp_regs[tgsi_dst->Index].offset;
+      dest.dest.reg.reg = c->temp_regs[index].reg;
+      dest.dest.reg.base_offset = c->temp_regs[index].offset;
    } else if (tgsi_dst->File == TGSI_FILE_OUTPUT) {
-      dest.dest.reg.reg = c->output_regs[tgsi_dst->Index].reg;
-      dest.dest.reg.base_offset = c->output_regs[tgsi_dst->Index].offset;
+      dest.dest.reg.reg = c->output_regs[index].reg;
+      dest.dest.reg.base_offset = c->output_regs[index].offset;
    } else if (tgsi_dst->File == TGSI_FILE_ADDRESS) {
-      assert(tgsi_dst->Index == 0);
+      assert(index == 0);
       dest.dest.reg.reg = c->addr_reg;
    }