From cd4b995254fe29bae9ab5a9563cc615274d361ed Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 5 Dec 2014 11:03:06 -0800 Subject: [PATCH] nir: Make texture instruction names more consistent 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 --- 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 c90425b1300..70f0c851f2a 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -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: diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index c376de1cf19..e9035d449c3 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -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: diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 0c21dca6baf..ecd174a88ad 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 4fa764ca378..d94183ceee0 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 a27d412a5f8..2447fe9cfc0 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 c3bbcb4d82d..365a8cd75df 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 9ad2849d376..68d0b6d1117 100644 --- a/src/glsl/nir/nir_print.c +++ b/src/glsl/nir/nir_print.c @@ -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: diff --git a/src/glsl/nir/nir_remove_dead_variables.c b/src/glsl/nir/nir_remove_dead_variables.c index caf117a3939..38b291ca04b 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 a76b7acc132..e73a6eef611 100644 --- a/src/glsl/nir/nir_to_ssa.c +++ b/src/glsl/nir/nir_to_ssa.c @@ -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 diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c index e10f38bc6eb..937cbb9bf6e 100644 --- a/src/glsl/nir/nir_validate.c +++ b/src/glsl/nir/nir_validate.c @@ -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: diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index b7120859324..56e180a138a 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.30.2