[Mesa-dev] [PATCH] ttn: Use the new nir_load_system_value helper

Jason Ekstrand jason at jlekstrand.net
Tue Dec 15 14:16:24 PST 2015


Only compile-tested.

Cc: Eric Anholt <eric at anholt.net>
---
 src/gallium/auxiliary/nir/tgsi_to_nir.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index 5def6d3..122e87b 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -544,9 +544,7 @@ ttn_src_for_file_and_index(struct ttn_compile *c, unsigned file, unsigned index,
       break;
 
    case TGSI_FILE_SYSTEM_VALUE: {
-      nir_intrinsic_instr *load;
       nir_intrinsic_op op;
-      unsigned ncomp = 1;
 
       assert(!indirect);
       assert(!dim);
@@ -568,13 +566,7 @@ ttn_src_for_file_and_index(struct ttn_compile *c, unsigned file, unsigned index,
          unreachable("bad system value");
       }
 
-      load = nir_intrinsic_instr_create(b->shader, op);
-      load->num_components = ncomp;
-
-      nir_ssa_dest_init(&load->instr, &load->dest, ncomp, NULL);
-      nir_builder_instr_insert(b, &load->instr);
-
-      src = nir_src_for_ssa(&load->dest.ssa);
+      src = nir_src_for_ssa(nir_load_system_value(b, op, 0));
       break;
    }
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list