nir: Make texture instruction names more consistent
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 5 Dec 2014 19:03:06 +0000 (11:03 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jan 2015 15:20:21 +0000 (07:20 -0800)
This commit renames nir_instr_as_texture to nir_instr_as_tex and renames
nir_instr_type_texture to nir_instr_type_tex to be consistent with
nir_tex_instr.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/glsl_to_nir.cpp
src/glsl/nir/nir.c
src/glsl/nir/nir.h
src/glsl/nir/nir_lower_samplers.cpp
src/glsl/nir/nir_opt_cse.c
src/glsl/nir/nir_opt_dce.c
src/glsl/nir/nir_print.c
src/glsl/nir/nir_remove_dead_variables.c
src/glsl/nir/nir_to_ssa.c
src/glsl/nir/nir_validate.c
src/mesa/drivers/dri/i965/brw_fs_nir.cpp

index c90425b13006652746acd0fee0e1ffb86f68c0ac..70f0c851f2af07754da1a414fc64738d46275d78 100644 (file)
@@ -790,8 +790,8 @@ get_instr_dest(nir_instr *instr)
          else
             return NULL;
 
-      case nir_instr_type_texture:
-         tex_instr = nir_instr_as_texture(instr);
+      case nir_instr_type_tex:
+         tex_instr = nir_instr_as_tex(instr);
          return &tex_instr->dest;
 
       case nir_instr_type_load_const:
index c376de1cf1947bc2b017d1f5baca780d291bc5a4..e9035d449c3fbbc09084c7cc3e259792def52357 100644 (file)
@@ -456,7 +456,7 @@ nir_tex_instr *
 nir_tex_instr_create(void *mem_ctx, unsigned num_srcs)
 {
    nir_tex_instr *instr = ralloc(mem_ctx, nir_tex_instr);
-   instr_init(&instr->instr, nir_instr_type_texture);
+   instr_init(&instr->instr, nir_instr_type_tex);
 
    dest_init(&instr->dest);
 
@@ -1453,8 +1453,8 @@ nir_foreach_dest(nir_instr *instr, nir_foreach_dest_cb cb, void *state)
       return visit_alu_dest(nir_instr_as_alu(instr), cb, state);
    case nir_instr_type_intrinsic:
       return visit_intrinsic_dest(nir_instr_as_intrinsic(instr), cb, state);
-   case nir_instr_type_texture:
-      return visit_texture_dest(nir_instr_as_texture(instr), cb, state);
+   case nir_instr_type_tex:
+      return visit_texture_dest(nir_instr_as_tex(instr), cb, state);
    case nir_instr_type_load_const:
       return visit_load_const_dest(nir_instr_as_load_const(instr), cb, state);
    case nir_instr_type_phi:
@@ -1636,8 +1636,8 @@ nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state)
       if (!visit_intrinsic_src(nir_instr_as_intrinsic(instr), cb, state))
          return false;
       break;
-   case nir_instr_type_texture:
-      if (!visit_tex_src(nir_instr_as_texture(instr), cb, state))
+   case nir_instr_type_tex:
+      if (!visit_tex_src(nir_instr_as_tex(instr), cb, state))
          return false;
       break;
    case nir_instr_type_call:
index 0c21dca6baff346e6b2ee0cfe745040c7794aab7..ecd174a88ad2c5c906e6a74efea0ffaa9c3374ea 100644 (file)
@@ -405,7 +405,7 @@ typedef struct {
 typedef enum {
    nir_instr_type_alu,
    nir_instr_type_call,
-   nir_instr_type_texture,
+   nir_instr_type_tex,
    nir_instr_type_intrinsic,
    nir_instr_type_load_const,
    nir_instr_type_jump,
@@ -993,7 +993,7 @@ typedef struct {
 NIR_DEFINE_CAST(nir_instr_as_alu, nir_instr, nir_alu_instr, instr)
 NIR_DEFINE_CAST(nir_instr_as_call, nir_instr, nir_call_instr, instr)
 NIR_DEFINE_CAST(nir_instr_as_jump, nir_instr, nir_jump_instr, instr)
-NIR_DEFINE_CAST(nir_instr_as_texture, nir_instr, nir_tex_instr, instr)
+NIR_DEFINE_CAST(nir_instr_as_tex, nir_instr, nir_tex_instr, instr)
 NIR_DEFINE_CAST(nir_instr_as_intrinsic, nir_instr, nir_intrinsic_instr, instr)
 NIR_DEFINE_CAST(nir_instr_as_load_const, nir_instr, nir_load_const_instr, instr)
 NIR_DEFINE_CAST(nir_instr_as_ssa_undef, nir_instr, nir_ssa_undef_instr, instr)
index 4fa764ca3789b72fc0b0b9c9a33cd7a1611c7147..d94183ceee022e02bf31651078c4897b2dec5b7b 100644 (file)
@@ -152,8 +152,8 @@ lower_block_cb(nir_block *block, void *_state)
    lower_state *state = (lower_state *) _state;
 
    nir_foreach_instr(block, instr) {
-      if (instr->type == nir_instr_type_texture) {
-         nir_tex_instr *tex_instr = nir_instr_as_texture(instr);
+      if (instr->type == nir_instr_type_tex) {
+         nir_tex_instr *tex_instr = nir_instr_as_tex(instr);
          lower_sampler(tex_instr, state->shader_program, state->prog);
       }
    }
index a27d412a5f8258186b8b9f0044ff3a48c4d8d925..2447fe9cfc054229c5b4c05be30fac554d98a5da 100644 (file)
@@ -87,7 +87,7 @@ nir_instrs_equal(nir_instr *instr1, nir_instr *instr2)
       }
       return true;
    }
-   case nir_instr_type_texture:
+   case nir_instr_type_tex:
       return false;
    case nir_instr_type_load_const: {
       nir_load_const_instr *load1 = nir_instr_as_load_const(instr1);
@@ -152,7 +152,7 @@ nir_instr_can_cse(nir_instr *instr)
    case nir_instr_type_phi:
       return nir_foreach_dest(instr, dest_is_ssa, NULL) &&
              nir_foreach_src(instr, src_is_ssa, NULL);
-   case nir_instr_type_texture:
+   case nir_instr_type_tex:
       return false; /* TODO */
    case nir_instr_type_intrinsic:
    case nir_instr_type_call:
index c3bbcb4d82d8aa459f75cf5c1f5d0eeaac579baf..365a8cd75df02d6bbaf16ca1e12aa0b9ef32c769 100644 (file)
@@ -98,8 +98,8 @@ init_instr(nir_instr *instr, struct exec_list *worklist)
       }
       break;
 
-   case nir_instr_type_texture:
-      tex_instr = nir_instr_as_texture(instr);
+   case nir_instr_type_tex:
+      tex_instr = nir_instr_as_tex(instr);
       if (!tex_instr->dest.is_ssa)
          worklist_push(worklist, instr);
       break;
index 9ad2849d376e2f9b91f51d4fa51598d41291954b..68d0b6d111743bdcbf624c09029299d8e3bdb87e 100644 (file)
@@ -655,8 +655,8 @@ print_instr(nir_instr *instr, print_var_state *state, unsigned tabs, FILE *fp)
       print_intrinsic_instr(nir_instr_as_intrinsic(instr), state, fp);
       break;
 
-   case nir_instr_type_texture:
-      print_tex_instr(nir_instr_as_texture(instr), state, fp);
+   case nir_instr_type_tex:
+      print_tex_instr(nir_instr_as_tex(instr), state, fp);
       break;
 
    case nir_instr_type_load_const:
index caf117a3939ac7c8784d92e9e69e043af4718b06..38b291ca04b538c149b571bff20d0efdf0cc34e8 100644 (file)
@@ -75,8 +75,8 @@ add_var_use_block(nir_block *block, void *state)
          add_var_use_call(nir_instr_as_call(instr), live);
          break;
 
-      case nir_instr_type_texture:
-         add_var_use_tex(nir_instr_as_texture(instr), live);
+      case nir_instr_type_tex:
+         add_var_use_tex(nir_instr_as_tex(instr), live);
          break;
 
       default:
index a76b7acc132b5dd6c058fbe9b8709a9b7cd73411..e73a6eef61126e90ee64760be37a938dd2cf4ed3 100644 (file)
@@ -433,8 +433,8 @@ get_instr_predicate(nir_instr *instr)
       else
          return NULL;
 
-   case nir_instr_type_texture:
-      tex_instr = nir_instr_as_texture(instr);
+   case nir_instr_type_tex:
+      tex_instr = nir_instr_as_tex(instr);
       if (tex_instr->has_predicate)
          return &tex_instr->predicate;
       else
index e10f38bc6eb80d4b7940e1026c3059e045616e65..937cbb9bf6e812d32ce9115ad4a529b0c0070c76 100644 (file)
@@ -473,8 +473,8 @@ validate_instr(nir_instr *instr, validate_state *state)
       validate_intrinsic_instr(nir_instr_as_intrinsic(instr), state);
       break;
 
-   case nir_instr_type_texture:
-      validate_tex_instr(nir_instr_as_texture(instr), state);
+   case nir_instr_type_tex:
+      validate_tex_instr(nir_instr_as_tex(instr), state);
       break;
 
    case nir_instr_type_load_const:
index b71208593242751719a9c95f12a0971bba8df7b8..56e180a138a2ffee79650397d65a3100bc90a443 100644 (file)
@@ -387,8 +387,8 @@ fs_visitor::nir_emit_instr(nir_instr *instr)
       nir_emit_intrinsic(nir_instr_as_intrinsic(instr));
       break;
 
-   case nir_instr_type_texture:
-      nir_emit_texture(nir_instr_as_texture(instr));
+   case nir_instr_type_tex:
+      nir_emit_texture(nir_instr_as_tex(instr));
       break;
 
    case nir_instr_type_load_const: