[Mesa-dev] [PATCH 3/4] gallium/ttn: minor cleanup

Rob Clark robdclark at gmail.com
Sun Apr 12 16:01:37 PDT 2015


From: Rob Clark <robclark at freedesktop.org>

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 src/gallium/auxiliary/nir/tgsi_to_nir.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index a2f15ed..610e5d9 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -361,25 +361,24 @@ ttn_src_for_file_and_index(struct ttn_compile *c, unsigned file, unsigned index,
    case TGSI_FILE_INPUT:
    case TGSI_FILE_CONSTANT: {
       nir_intrinsic_instr *load;
+      nir_intrinsic_op op;
 
       switch (file) {
       case TGSI_FILE_INPUT:
-         load = nir_intrinsic_instr_create(b->shader,
-                                           indirect ?
-                                           nir_intrinsic_load_input_indirect :
-                                           nir_intrinsic_load_input);
+         op = indirect ? nir_intrinsic_load_input_indirect :
+                         nir_intrinsic_load_input;
          break;
       case TGSI_FILE_CONSTANT:
-         load = nir_intrinsic_instr_create(b->shader,
-                                           indirect ?
-                                           nir_intrinsic_load_uniform_indirect :
-                                           nir_intrinsic_load_uniform);
+         op = indirect ? nir_intrinsic_load_uniform_indirect :
+                         nir_intrinsic_load_uniform;
          break;
       default:
          unreachable("No other load files supported");
          break;
       }
 
+      load = nir_intrinsic_instr_create(b->shader, op);
+
       load->num_components = 4;
       load->const_index[0] = index;
       load->const_index[1] = 1;
-- 
2.1.0



More information about the mesa-dev mailing list