Commit cd4b9952 authored by Jason Ekstrand's avatar Jason Ekstrand
Browse files

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: default avatarConnor Abbott <cwabbott0@gmail.com>
parent d6fe35a4
......@@ -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:
......
......@@ -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:
......
......@@ -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)
......
......@@ -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);
}
}
......
......@@ -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:
......
......@@ -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;
......
......@@ -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:
......
......@@ -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:
......
......@@ -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
......
......@@ -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:
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment