[Mesa-dev] [PATCH 115/133] nir: Make texture instruction names more consistent
Jason Ekstrand
jason at jlekstrand.net
Mon Dec 15 22:12:58 PST 2014
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.
---
src/glsl/nir/glsl_to_nir.cpp | 4 ++--
src/glsl/nir/nir.c | 10 +++++-----
src/glsl/nir/nir.h | 4 ++--
src/glsl/nir/nir_lower_samplers.cpp | 4 ++--
src/glsl/nir/nir_opt_cse.c | 4 ++--
src/glsl/nir/nir_opt_dce.c | 4 ++--
src/glsl/nir/nir_print.c | 4 ++--
src/glsl/nir/nir_remove_dead_variables.c | 4 ++--
src/glsl/nir/nir_to_ssa.c | 4 ++--
src/glsl/nir/nir_validate.c | 4 ++--
src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 4 ++--
11 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index 5ead8cd..b32bea1 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -795,8 +795,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:
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index f5183ce..60c9cff 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -452,7 +452,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);
instr->num_srcs = num_srcs;
for (unsigned i = 0; i < num_srcs; i++)
@@ -1447,8 +1447,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:
@@ -1630,8 +1630,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:
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 46f069f..32bf634 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -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)
diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp
index 4fa764c..d94183c 100644
--- a/src/glsl/nir/nir_lower_samplers.cpp
+++ b/src/glsl/nir/nir_lower_samplers.cpp
@@ -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);
}
}
diff --git a/src/glsl/nir/nir_opt_cse.c b/src/glsl/nir/nir_opt_cse.c
index a27d412..2447fe9 100644
--- a/src/glsl/nir/nir_opt_cse.c
+++ b/src/glsl/nir/nir_opt_cse.c
@@ -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:
diff --git a/src/glsl/nir/nir_opt_dce.c b/src/glsl/nir/nir_opt_dce.c
index c3bbcb4..365a8cd 100644
--- a/src/glsl/nir/nir_opt_dce.c
+++ b/src/glsl/nir/nir_opt_dce.c
@@ -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;
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c
index b631af3..962e408 100644
--- a/src/glsl/nir/nir_print.c
+++ b/src/glsl/nir/nir_print.c
@@ -656,8 +656,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:
diff --git a/src/glsl/nir/nir_remove_dead_variables.c b/src/glsl/nir/nir_remove_dead_variables.c
index caf117a..38b291c 100644
--- a/src/glsl/nir/nir_remove_dead_variables.c
+++ b/src/glsl/nir/nir_remove_dead_variables.c
@@ -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:
diff --git a/src/glsl/nir/nir_to_ssa.c b/src/glsl/nir/nir_to_ssa.c
index ed12750..757fcf0 100644
--- a/src/glsl/nir/nir_to_ssa.c
+++ b/src/glsl/nir/nir_to_ssa.c
@@ -434,8 +434,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
diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c
index 6051784..e565b3c 100644
--- a/src/glsl/nir/nir_validate.c
+++ b/src/glsl/nir/nir_validate.c
@@ -479,8 +479,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:
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index f719c86..fde96fa 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -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:
--
2.2.0
More information about the mesa-dev
mailing list