[Mesa-dev] [PATCH 02/14] glsl_to_tgsi: remove unused parameters from calc_deref_offsets
Marek Olšák
maraeo at gmail.com
Mon Oct 17 13:39:14 UTC 2016
From: Marek Olšák <marek.olsak at amd.com>
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 5bc2661..b857a5b 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -551,24 +551,22 @@ public:
void emit_scalar(ir_instruction *ir, unsigned op,
st_dst_reg dst, st_src_reg src0, st_src_reg src1);
void emit_arl(ir_instruction *ir, st_dst_reg dst, st_src_reg src0);
void get_deref_offsets(ir_dereference *ir,
unsigned *array_size,
unsigned *base,
unsigned *index,
st_src_reg *reladdr);
- void calc_deref_offsets(ir_dereference *head,
- ir_dereference *tail,
+ void calc_deref_offsets(ir_dereference *tail,
unsigned *array_elements,
- unsigned *base,
unsigned *index,
st_src_reg *indirect,
unsigned *location);
st_src_reg canonicalize_gather_offset(st_src_reg offset);
bool try_emit_mad(ir_expression *ir,
int mul_operand);
bool try_emit_mad_for_and_not(ir_expression *ir,
int mul_operand);
@@ -3878,35 +3876,33 @@ glsl_to_tgsi_visitor::visit(ir_call *ir)
r.index++;
}
}
}
/* Process return value. */
this->result = entry->return_reg;
}
void
-glsl_to_tgsi_visitor::calc_deref_offsets(ir_dereference *head,
- ir_dereference *tail,
+glsl_to_tgsi_visitor::calc_deref_offsets(ir_dereference *tail,
unsigned *array_elements,
- unsigned *base,
unsigned *index,
st_src_reg *indirect,
unsigned *location)
{
switch (tail->ir_type) {
case ir_type_dereference_record: {
ir_dereference_record *deref_record = tail->as_dereference_record();
const glsl_type *struct_type = deref_record->record->type;
int field_index = deref_record->record->type->field_index(deref_record->field);
- calc_deref_offsets(head, deref_record->record->as_dereference(), array_elements, base, index, indirect, location);
+ calc_deref_offsets(deref_record->record->as_dereference(), array_elements, index, indirect, location);
assert(field_index >= 0);
*location += struct_type->record_location_offset(field_index);
break;
}
case ir_type_dereference_array: {
ir_dereference_array *deref_arr = tail->as_dereference_array();
ir_constant *array_index = deref_arr->array_index->constant_expression_value();
@@ -3929,21 +3925,21 @@ glsl_to_tgsi_visitor::calc_deref_offsets(ir_dereference *head,
else {
temp_dst = st_dst_reg(*indirect);
temp_dst.writemask = 1;
emit_asm(NULL, TGSI_OPCODE_ADD, temp_dst, *indirect, temp_reg);
}
} else
*index += array_index->value.u[0] * *array_elements;
*array_elements *= deref_arr->array->type->length;
- calc_deref_offsets(head, deref_arr->array->as_dereference(), array_elements, base, index, indirect, location);
+ calc_deref_offsets(deref_arr->array->as_dereference(), array_elements, index, indirect, location);
break;
}
default:
break;
}
}
void
glsl_to_tgsi_visitor::get_deref_offsets(ir_dereference *ir,
unsigned *array_size,
@@ -3956,21 +3952,21 @@ glsl_to_tgsi_visitor::get_deref_offsets(ir_dereference *ir,
ir_variable *var = ir->variable_referenced();
memset(reladdr, 0, sizeof(*reladdr));
reladdr->file = PROGRAM_UNDEFINED;
*base = 0;
*array_size = 1;
assert(var);
location = var->data.location;
- calc_deref_offsets(ir, ir, array_size, base, index, reladdr, &location);
+ calc_deref_offsets(ir, array_size, index, reladdr, &location);
/*
* If we end up with no indirect then adjust the base to the index,
* and set the array size to 1.
*/
if (reladdr->file == PROGRAM_UNDEFINED) {
*base = *index;
*array_size = 1;
}
--
2.7.4
More information about the mesa-dev
mailing list