Mesa (master): nv50,nvc0: do not forget to apply sign mode to saved TGSI inputs

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Wed Feb 9 15:05:53 UTC 2011


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

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Mon Feb  7 14:54:17 2011 +0100

nv50,nvc0: do not forget to apply sign mode to saved TGSI inputs

---

 src/gallium/drivers/nv50/nv50_tgsi_to_nc.c |    2 +-
 src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c |   12 ++----------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
index d6b80c3..ce9300a 100644
--- a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
+++ b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c
@@ -1130,7 +1130,7 @@ emit_fetch(struct bld_context *bld, const struct tgsi_full_instruction *insn,
    case TGSI_FILE_INPUT:
       res = bld_saved_input(bld, idx, swz);
       if (res && (insn->Instruction.Opcode != TGSI_OPCODE_TXP))
-         return res;
+         break;
 
       res = new_value(bld->pc, bld->ti->input_file, type);
       res->reg.id = bld->ti->input_map[idx][swz];
diff --git a/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c b/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c
index 8b6cb0e..dd1c7f7 100644
--- a/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c
+++ b/src/gallium/drivers/nvc0/nvc0_tgsi_to_nc.c
@@ -984,14 +984,6 @@ bld_new_block(struct bld_context *bld, struct nv_basic_block *b)
 }
 
 static struct nv_value *
-bld_get_saved_input(struct bld_context *bld, unsigned i, unsigned c)
-{
-   if (bld->saved_inputs[i][c])
-      return bld->saved_inputs[i][c];
-   return NULL;
-}
-
-static struct nv_value *
 bld_interp(struct bld_context *bld, unsigned mode, struct nv_value *val)
 {
    unsigned cent = mode & NVC0_INTERP_CENTROID;
@@ -1058,9 +1050,9 @@ emit_fetch(struct bld_context *bld, const struct tgsi_full_instruction *insn,
    case TGSI_FILE_INPUT:
       assert(!src->Register.Dimension);
       if (!ptr) {
-         res = bld_get_saved_input(bld, idx, swz);
+         res = bld->saved_inputs[idx][swz];
          if (res)
-            return res;
+            break;
       }
       res = new_value(bld->pc, bld->ti->input_file, 4);
       if (ptr)




More information about the mesa-commit mailing list