aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/glsl_to_nir.cpp
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-05-11 15:05:09 -0400
committerRob Clark <[email protected]>2016-05-12 13:39:40 -0400
commit9d3cc80b752b236bc51b78a3d99920748a1a230a (patch)
treec518c99153ecd2af941e400d47383ac90e9632cf /src/compiler/nir/glsl_to_nir.cpp
parentb19cff1639f9c6e3074d11f1199807603046ea4b (diff)
nir: glsl_get_bit_size() should take glsl_type
It's what all the call-sites once, so gets rid of a bunch of inlined glsl_get_base_type() at the call-sites. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/glsl_to_nir.cpp')
-rw-r--r--src/compiler/nir/glsl_to_nir.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp
index a86b966a26b..aeeba5d5573 100644
--- a/src/compiler/nir/glsl_to_nir.cpp
+++ b/src/compiler/nir/glsl_to_nir.cpp
@@ -856,7 +856,7 @@ nir_visitor::visit(ir_call *ir)
instr->num_components = type->vector_elements;
/* Setup destination register */
- unsigned bit_size = glsl_get_bit_size(type->base_type);
+ unsigned bit_size = glsl_get_bit_size(type);
nir_ssa_dest_init(&instr->instr, &instr->dest,
type->vector_elements, bit_size, NULL);
@@ -942,7 +942,7 @@ nir_visitor::visit(ir_call *ir)
instr->num_components = type->vector_elements;
/* Setup destination register */
- unsigned bit_size = glsl_get_bit_size(type->base_type);
+ unsigned bit_size = glsl_get_bit_size(type);
nir_ssa_dest_init(&instr->instr, &instr->dest,
type->vector_elements, bit_size, NULL);
@@ -1005,7 +1005,7 @@ nir_visitor::visit(ir_call *ir)
/* Atomic result */
assert(ir->return_deref);
- unsigned bit_size = glsl_get_bit_size(ir->return_deref->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->return_deref->type);
nir_ssa_dest_init(&instr->instr, &instr->dest,
ir->return_deref->type->vector_elements,
bit_size, NULL);
@@ -1186,7 +1186,7 @@ nir_visitor::evaluate_rvalue(ir_rvalue* ir)
load_instr->num_components = ir->type->vector_elements;
load_instr->variables[0] = this->deref_head;
ralloc_steal(load_instr, load_instr->variables[0]);
- unsigned bit_size = glsl_get_bit_size(ir->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->type);
add_instr(&load_instr->instr, ir->type->vector_elements, bit_size);
}
@@ -1207,7 +1207,7 @@ nir_visitor::visit(ir_expression *ir)
case ir_binop_ubo_load: {
nir_intrinsic_instr *load =
nir_intrinsic_instr_create(this->shader, nir_intrinsic_load_ubo);
- unsigned bit_size = glsl_get_bit_size(ir->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->type);
load->num_components = ir->type->vector_elements;
load->src[0] = nir_src_for_ssa(evaluate_rvalue(ir->operands[0]));
load->src[1] = nir_src_for_ssa(evaluate_rvalue(ir->operands[1]));
@@ -1276,7 +1276,7 @@ nir_visitor::visit(ir_expression *ir)
intrin->intrinsic == nir_intrinsic_interp_var_at_sample)
intrin->src[0] = nir_src_for_ssa(evaluate_rvalue(ir->operands[1]));
- unsigned bit_size = glsl_get_bit_size(deref->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(deref->type);
add_instr(&intrin->instr, deref->type->vector_elements, bit_size);
if (swizzle) {
@@ -1496,7 +1496,7 @@ nir_visitor::visit(ir_expression *ir)
nir_intrinsic_get_buffer_size);
load->num_components = ir->type->vector_elements;
load->src[0] = nir_src_for_ssa(evaluate_rvalue(ir->operands[0]));
- unsigned bit_size = glsl_get_bit_size(ir->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->type);
add_instr(&load->instr, ir->type->vector_elements, bit_size);
return;
}
@@ -1934,7 +1934,7 @@ nir_visitor::visit(ir_texture *ir)
assert(src_number == num_srcs);
- unsigned bit_size = glsl_get_bit_size(ir->type->base_type);
+ unsigned bit_size = glsl_get_bit_size(ir->type);
add_instr(&instr->instr, nir_tex_instr_dest_size(instr), bit_size);
}