glsl: Use typed foreach_in_list_safe instead of foreach_list_safe.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
@@ -685,8 +685,7 @@ process_vec_mat_constructor(exec_list *instructions,
|
|||||||
bool all_parameters_are_constant = true;
|
bool all_parameters_are_constant = true;
|
||||||
|
|
||||||
/* Type cast each parameter and, if possible, fold constants. */
|
/* Type cast each parameter and, if possible, fold constants. */
|
||||||
foreach_list_safe(n, &actual_parameters) {
|
foreach_in_list_safe(ir_rvalue, ir, &actual_parameters) {
|
||||||
ir_rvalue *ir = (ir_rvalue *) n;
|
|
||||||
ir_rvalue *result = ir;
|
ir_rvalue *result = ir;
|
||||||
|
|
||||||
/* Apply implicit conversions (not the scalar constructor rules!). See
|
/* Apply implicit conversions (not the scalar constructor rules!). See
|
||||||
@@ -813,8 +812,7 @@ process_array_constructor(exec_list *instructions,
|
|||||||
bool all_parameters_are_constant = true;
|
bool all_parameters_are_constant = true;
|
||||||
|
|
||||||
/* Type cast each parameter and, if possible, fold constants. */
|
/* Type cast each parameter and, if possible, fold constants. */
|
||||||
foreach_list_safe(n, &actual_parameters) {
|
foreach_in_list_safe(ir_rvalue, ir, &actual_parameters) {
|
||||||
ir_rvalue *ir = (ir_rvalue *) n;
|
|
||||||
ir_rvalue *result = ir;
|
ir_rvalue *result = ir;
|
||||||
|
|
||||||
/* Apply implicit conversions (not the scalar constructor rules!). See
|
/* Apply implicit conversions (not the scalar constructor rules!). See
|
||||||
@@ -1629,9 +1627,7 @@ ast_function_expression::hir(exec_list *instructions,
|
|||||||
* need to break them up into a series of column vectors.
|
* need to break them up into a series of column vectors.
|
||||||
*/
|
*/
|
||||||
if (constructor_type->base_type != GLSL_TYPE_FLOAT) {
|
if (constructor_type->base_type != GLSL_TYPE_FLOAT) {
|
||||||
foreach_list_safe(n, &actual_parameters) {
|
foreach_in_list_safe(ir_rvalue, matrix, &actual_parameters) {
|
||||||
ir_rvalue *matrix = (ir_rvalue *) n;
|
|
||||||
|
|
||||||
if (!matrix->type->is_matrix())
|
if (!matrix->type->is_matrix())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -1655,9 +1651,7 @@ ast_function_expression::hir(exec_list *instructions,
|
|||||||
bool all_parameters_are_constant = true;
|
bool all_parameters_are_constant = true;
|
||||||
|
|
||||||
/* Type cast each parameter and, if possible, fold constants.*/
|
/* Type cast each parameter and, if possible, fold constants.*/
|
||||||
foreach_list_safe(n, &actual_parameters) {
|
foreach_in_list_safe(ir_rvalue, ir, &actual_parameters) {
|
||||||
ir_rvalue *ir = (ir_rvalue *) n;
|
|
||||||
|
|
||||||
const glsl_type *desired_type =
|
const glsl_type *desired_type =
|
||||||
glsl_type::get_instance(constructor_type->base_type,
|
glsl_type::get_instance(constructor_type->base_type,
|
||||||
ir->type->vector_elements,
|
ir->type->vector_elements,
|
||||||
|
@@ -112,8 +112,8 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
|
|||||||
* applications depend on this behavior, and it matches what nearly all
|
* applications depend on this behavior, and it matches what nearly all
|
||||||
* other drivers do.
|
* other drivers do.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(node, instructions) {
|
foreach_in_list_safe(ir_instruction, node, instructions) {
|
||||||
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
ir_variable *const var = node->as_variable();
|
||||||
|
|
||||||
if (var == NULL)
|
if (var == NULL)
|
||||||
continue;
|
continue;
|
||||||
@@ -5619,8 +5619,8 @@ ast_interface_block::hir(exec_list *instructions,
|
|||||||
* thinking there are conflicting definitions of gl_PerVertex in the
|
* thinking there are conflicting definitions of gl_PerVertex in the
|
||||||
* shader.
|
* shader.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(node, instructions) {
|
foreach_in_list_safe(ir_instruction, node, instructions) {
|
||||||
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
ir_variable *const var = node->as_variable();
|
||||||
if (var != NULL &&
|
if (var != NULL &&
|
||||||
var->get_interface_type() == earlier_per_vertex &&
|
var->get_interface_type() == earlier_per_vertex &&
|
||||||
var->data.mode == var_mode) {
|
var->data.mode == var_mode) {
|
||||||
@@ -5884,8 +5884,8 @@ remove_per_vertex_blocks(exec_list *instructions,
|
|||||||
/* Remove any ir_variable declarations that refer to the interface block
|
/* Remove any ir_variable declarations that refer to the interface block
|
||||||
* we're removing.
|
* we're removing.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(node, instructions) {
|
foreach_in_list_safe(ir_instruction, node, instructions) {
|
||||||
ir_variable *const var = ((ir_instruction *) node)->as_variable();
|
ir_variable *const var = node->as_variable();
|
||||||
if (var != NULL && var->get_interface_type() == per_vertex &&
|
if (var != NULL && var->get_interface_type() == per_vertex &&
|
||||||
var->data.mode == mode) {
|
var->data.mode == mode) {
|
||||||
state->symbols->disable_variable(var->name);
|
state->symbols->disable_variable(var->name);
|
||||||
|
@@ -1720,8 +1720,8 @@ ir_rvalue::error_value(void *mem_ctx)
|
|||||||
void
|
void
|
||||||
visit_exec_list(exec_list *list, ir_visitor *visitor)
|
visit_exec_list(exec_list *list, ir_visitor *visitor)
|
||||||
{
|
{
|
||||||
foreach_list_safe(n, list) {
|
foreach_in_list_safe(ir_instruction, node, list) {
|
||||||
((ir_instruction *) n)->accept(visitor);
|
node->accept(visitor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -229,15 +229,13 @@ public:
|
|||||||
static void
|
static void
|
||||||
destroy_links(exec_list *list, function *f)
|
destroy_links(exec_list *list, function *f)
|
||||||
{
|
{
|
||||||
foreach_list_safe(node, list) {
|
foreach_in_list_safe(call_node, node, list) {
|
||||||
struct call_node *n = (struct call_node *) node;
|
|
||||||
|
|
||||||
/* If this is the right function, remove it. Note that the loop cannot
|
/* If this is the right function, remove it. Note that the loop cannot
|
||||||
* terminate now. There can be multiple links to a function if it is
|
* terminate now. There can be multiple links to a function if it is
|
||||||
* either called multiple times or calls multiple times.
|
* either called multiple times or calls multiple times.
|
||||||
*/
|
*/
|
||||||
if (n->func == f)
|
if (node->func == f)
|
||||||
n->remove();
|
node->remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,8 +49,7 @@ visit_list_elements(ir_hierarchical_visitor *v, exec_list *l,
|
|||||||
{
|
{
|
||||||
ir_instruction *prev_base_ir = v->base_ir;
|
ir_instruction *prev_base_ir = v->base_ir;
|
||||||
|
|
||||||
foreach_list_safe(n, l) {
|
foreach_in_list_safe(ir_instruction, ir, l) {
|
||||||
ir_instruction *const ir = (ir_instruction *) n;
|
|
||||||
if (statement_list)
|
if (statement_list)
|
||||||
v->base_ir = ir;
|
v->base_ir = ir;
|
||||||
ir_visitor_status s = ir->accept(v);
|
ir_visitor_status s = ir->accept(v);
|
||||||
|
@@ -123,8 +123,7 @@ ir_rvalue_base_visitor::rvalue_visit(ir_assignment *ir)
|
|||||||
ir_visitor_status
|
ir_visitor_status
|
||||||
ir_rvalue_base_visitor::rvalue_visit(ir_call *ir)
|
ir_rvalue_base_visitor::rvalue_visit(ir_call *ir)
|
||||||
{
|
{
|
||||||
foreach_list_safe(n, &ir->actual_parameters) {
|
foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) {
|
||||||
ir_rvalue *param = (ir_rvalue *) n;
|
|
||||||
ir_rvalue *new_param = param;
|
ir_rvalue *new_param = param;
|
||||||
handle_rvalue(&new_param);
|
handle_rvalue(&new_param);
|
||||||
|
|
||||||
|
@@ -1078,9 +1078,7 @@ move_non_declarations(exec_list *instructions, exec_node *last,
|
|||||||
temps = hash_table_ctor(0, hash_table_pointer_hash,
|
temps = hash_table_ctor(0, hash_table_pointer_hash,
|
||||||
hash_table_pointer_compare);
|
hash_table_pointer_compare);
|
||||||
|
|
||||||
foreach_list_safe(node, instructions) {
|
foreach_in_list_safe(ir_instruction, inst, instructions) {
|
||||||
ir_instruction *inst = (ir_instruction *) node;
|
|
||||||
|
|
||||||
if (inst->as_function())
|
if (inst->as_function())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@@ -300,9 +300,7 @@ loop_analysis::visit_leave(ir_loop *ir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach_list_safe(node, &ls->variables) {
|
foreach_in_list_safe(loop_variable, lv, &ls->variables) {
|
||||||
loop_variable *lv = (loop_variable *) node;
|
|
||||||
|
|
||||||
/* Move variables that are already marked as being loop constant to
|
/* Move variables that are already marked as being loop constant to
|
||||||
* a separate list. These trivially don't need to be tested.
|
* a separate list. These trivially don't need to be tested.
|
||||||
*/
|
*/
|
||||||
@@ -330,9 +328,7 @@ loop_analysis::visit_leave(ir_loop *ir)
|
|||||||
do {
|
do {
|
||||||
progress = false;
|
progress = false;
|
||||||
|
|
||||||
foreach_list_safe(node, &ls->variables) {
|
foreach_in_list_safe(loop_variable, lv, &ls->variables) {
|
||||||
loop_variable *lv = (loop_variable *) node;
|
|
||||||
|
|
||||||
if (lv->conditional_or_nested_assignment || (lv->num_assignments > 1))
|
if (lv->conditional_or_nested_assignment || (lv->num_assignments > 1))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -356,9 +352,7 @@ loop_analysis::visit_leave(ir_loop *ir)
|
|||||||
/* The remaining variables that are not loop invariant might be loop
|
/* The remaining variables that are not loop invariant might be loop
|
||||||
* induction variables.
|
* induction variables.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(node, &ls->variables) {
|
foreach_in_list_safe(loop_variable, lv, &ls->variables) {
|
||||||
loop_variable *lv = (loop_variable *) node;
|
|
||||||
|
|
||||||
/* If there is more than one assignment to a variable, it cannot be a
|
/* If there is more than one assignment to a variable, it cannot be a
|
||||||
* loop induction variable. This isn't strictly true, but this is a
|
* loop induction variable. This isn't strictly true, but this is a
|
||||||
* very simple induction variable detector, and it can't handle more
|
* very simple induction variable detector, and it can't handle more
|
||||||
|
@@ -116,9 +116,7 @@ move_block_to_cond_assign(void *mem_ctx,
|
|||||||
exec_list *instructions,
|
exec_list *instructions,
|
||||||
struct hash_table *ht)
|
struct hash_table *ht)
|
||||||
{
|
{
|
||||||
foreach_list_safe(node, instructions) {
|
foreach_in_list_safe(ir_instruction, ir, instructions) {
|
||||||
ir_instruction *ir = (ir_instruction *) node;
|
|
||||||
|
|
||||||
if (ir->ir_type == ir_type_assignment) {
|
if (ir->ir_type == ir_type_assignment) {
|
||||||
ir_assignment *assign = (ir_assignment *)ir;
|
ir_assignment *assign = (ir_assignment *)ir;
|
||||||
|
|
||||||
|
@@ -99,8 +99,8 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions)
|
|||||||
* The interface block variables are stored in the interface_namespace
|
* The interface block variables are stored in the interface_namespace
|
||||||
* hash table so they can be used in the second pass.
|
* hash table so they can be used in the second pass.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(node, instructions) {
|
foreach_in_list_safe(ir_instruction, node, instructions) {
|
||||||
ir_variable *var = ((ir_instruction *) node)->as_variable();
|
ir_variable *var = node->as_variable();
|
||||||
if (!var || !var->is_interface_instance())
|
if (!var || !var->is_interface_instance())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@@ -197,8 +197,7 @@ ir_vec_index_to_cond_assign_visitor::visit_leave(ir_assignment *ir)
|
|||||||
ir_visitor_status
|
ir_visitor_status
|
||||||
ir_vec_index_to_cond_assign_visitor::visit_enter(ir_call *ir)
|
ir_vec_index_to_cond_assign_visitor::visit_enter(ir_call *ir)
|
||||||
{
|
{
|
||||||
foreach_list_safe(n, &ir->actual_parameters) {
|
foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) {
|
||||||
ir_rvalue *param = (ir_rvalue *) n;
|
|
||||||
ir_rvalue *new_param = convert_vector_extract_to_cond_assign(param);
|
ir_rvalue *new_param = convert_vector_extract_to_cond_assign(param);
|
||||||
|
|
||||||
if (new_param != param) {
|
if (new_param != param) {
|
||||||
|
@@ -131,8 +131,7 @@ ir_vec_index_to_swizzle_visitor::visit_enter(ir_assignment *ir)
|
|||||||
ir_visitor_status
|
ir_visitor_status
|
||||||
ir_vec_index_to_swizzle_visitor::visit_enter(ir_call *ir)
|
ir_vec_index_to_swizzle_visitor::visit_enter(ir_call *ir)
|
||||||
{
|
{
|
||||||
foreach_list_safe(n, &ir->actual_parameters) {
|
foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) {
|
||||||
ir_rvalue *param = (ir_rvalue *) n;
|
|
||||||
ir_rvalue *new_param = convert_vector_extract_to_swizzle(param);
|
ir_rvalue *new_param = convert_vector_extract_to_swizzle(param);
|
||||||
|
|
||||||
if (new_param != param) {
|
if (new_param != param) {
|
||||||
|
@@ -223,9 +223,7 @@ ir_array_reference_visitor::get_split_list(exec_list *instructions,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Trim out variables we found that we can't split. */
|
/* Trim out variables we found that we can't split. */
|
||||||
foreach_list_safe(n, &variable_list) {
|
foreach_in_list_safe(variable_entry, entry, &variable_list) {
|
||||||
variable_entry *entry = (variable_entry *) n;
|
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
printf("array %s@%p: decl %d, split %d\n",
|
printf("array %s@%p: decl %d, split %d\n",
|
||||||
entry->var->name, (void *) entry->var, entry->declaration,
|
entry->var->name, (void *) entry->var, entry->declaration,
|
||||||
|
@@ -393,9 +393,7 @@ ir_constant_propagation_visitor::kill(ir_variable *var, unsigned write_mask)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Remove any entries currently in the ACP for this kill. */
|
/* Remove any entries currently in the ACP for this kill. */
|
||||||
foreach_list_safe(n, this->acp) {
|
foreach_in_list_safe(acp_entry, entry, this->acp) {
|
||||||
acp_entry *entry = (acp_entry *) n;
|
|
||||||
|
|
||||||
if (entry->var == var) {
|
if (entry->var == var) {
|
||||||
entry->write_mask &= ~write_mask;
|
entry->write_mask &= ~write_mask;
|
||||||
if (entry->write_mask == 0)
|
if (entry->write_mask == 0)
|
||||||
|
@@ -286,9 +286,7 @@ ir_copy_propagation_visitor::kill(ir_variable *var)
|
|||||||
assert(var != NULL);
|
assert(var != NULL);
|
||||||
|
|
||||||
/* Remove any entries currently in the ACP for this kill. */
|
/* Remove any entries currently in the ACP for this kill. */
|
||||||
foreach_list_safe(n, acp) {
|
foreach_in_list_safe(acp_entry, entry, acp) {
|
||||||
acp_entry *entry = (acp_entry *) n;
|
|
||||||
|
|
||||||
if (entry->lhs == var || entry->rhs == var) {
|
if (entry->lhs == var || entry->rhs == var) {
|
||||||
entry->remove();
|
entry->remove();
|
||||||
}
|
}
|
||||||
|
@@ -340,8 +340,7 @@ ir_copy_propagation_elements_visitor::handle_if_block(exec_list *instructions)
|
|||||||
/* Move the new kills into the parent block's list, removing them
|
/* Move the new kills into the parent block's list, removing them
|
||||||
* from the parent's ACP list in the process.
|
* from the parent's ACP list in the process.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(node, new_kills) {
|
foreach_in_list_safe(kill_entry, k, new_kills) {
|
||||||
kill_entry *k = (kill_entry *)node;
|
|
||||||
kill(k);
|
kill(k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -384,8 +383,7 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir)
|
|||||||
this->acp = orig_acp;
|
this->acp = orig_acp;
|
||||||
this->killed_all = this->killed_all || orig_killed_all;
|
this->killed_all = this->killed_all || orig_killed_all;
|
||||||
|
|
||||||
foreach_list_safe(node, new_kills) {
|
foreach_in_list_safe(kill_entry, k, new_kills) {
|
||||||
kill_entry *k = (kill_entry *)node;
|
|
||||||
kill(k);
|
kill(k);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,9 +395,7 @@ ir_copy_propagation_elements_visitor::visit_enter(ir_loop *ir)
|
|||||||
void
|
void
|
||||||
ir_copy_propagation_elements_visitor::kill(kill_entry *k)
|
ir_copy_propagation_elements_visitor::kill(kill_entry *k)
|
||||||
{
|
{
|
||||||
foreach_list_safe(node, acp) {
|
foreach_in_list_safe(acp_entry, entry, acp) {
|
||||||
acp_entry *entry = (acp_entry *)node;
|
|
||||||
|
|
||||||
if (entry->lhs == k->var) {
|
if (entry->lhs == k->var) {
|
||||||
entry->write_mask = entry->write_mask & ~k->write_mask;
|
entry->write_mask = entry->write_mask & ~k->write_mask;
|
||||||
if (entry->write_mask == 0) {
|
if (entry->write_mask == 0) {
|
||||||
|
@@ -70,9 +70,7 @@ public:
|
|||||||
|
|
||||||
void use_channels(ir_variable *const var, int used)
|
void use_channels(ir_variable *const var, int used)
|
||||||
{
|
{
|
||||||
foreach_list_safe(n, this->assignments) {
|
foreach_in_list_safe(assignment_entry, entry, this->assignments) {
|
||||||
assignment_entry *entry = (assignment_entry *) n;
|
|
||||||
|
|
||||||
if (entry->lhs == var) {
|
if (entry->lhs == var) {
|
||||||
if (var->type->is_scalar() || var->type->is_vector()) {
|
if (var->type->is_scalar() || var->type->is_vector()) {
|
||||||
if (debug)
|
if (debug)
|
||||||
@@ -119,8 +117,7 @@ public:
|
|||||||
/* For the purpose of dead code elimination, emitting a vertex counts as
|
/* For the purpose of dead code elimination, emitting a vertex counts as
|
||||||
* "reading" all of the currently assigned output variables.
|
* "reading" all of the currently assigned output variables.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(n, this->assignments) {
|
foreach_in_list_safe(assignment_entry, entry, this->assignments) {
|
||||||
assignment_entry *entry = (assignment_entry *) n;
|
|
||||||
if (entry->lhs->data.mode == ir_var_shader_out) {
|
if (entry->lhs->data.mode == ir_var_shader_out) {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("kill %s\n", entry->lhs->name);
|
printf("kill %s\n", entry->lhs->name);
|
||||||
@@ -196,9 +193,7 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
|
|||||||
printf("looking for %s.0x%01x to remove\n", var->name,
|
printf("looking for %s.0x%01x to remove\n", var->name,
|
||||||
ir->write_mask);
|
ir->write_mask);
|
||||||
|
|
||||||
foreach_list_safe(n, assignments) {
|
foreach_in_list_safe(assignment_entry, entry, assignments) {
|
||||||
assignment_entry *entry = (assignment_entry *) n;
|
|
||||||
|
|
||||||
if (entry->lhs != var)
|
if (entry->lhs != var)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -258,9 +253,7 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
|
|||||||
*/
|
*/
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("looking for %s to remove\n", var->name);
|
printf("looking for %s to remove\n", var->name);
|
||||||
foreach_list_safe(n, assignments) {
|
foreach_in_list_safe(assignment_entry, entry, assignments) {
|
||||||
assignment_entry *entry = (assignment_entry *) n;
|
|
||||||
|
|
||||||
if (entry->lhs == var) {
|
if (entry->lhs == var) {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("removing %s\n", var->name);
|
printf("removing %s\n", var->name);
|
||||||
|
@@ -122,9 +122,7 @@ do_dead_functions(exec_list *instructions)
|
|||||||
* the unused ones, and remove function definitions that have no more
|
* the unused ones, and remove function definitions that have no more
|
||||||
* signatures.
|
* signatures.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(n, &v.signature_list) {
|
foreach_in_list_safe(signature_entry, entry, &v.signature_list) {
|
||||||
signature_entry *entry = (signature_entry *) n;
|
|
||||||
|
|
||||||
if (!entry->used) {
|
if (!entry->used) {
|
||||||
entry->signature->remove();
|
entry->signature->remove();
|
||||||
delete entry->signature;
|
delete entry->signature;
|
||||||
@@ -136,8 +134,7 @@ do_dead_functions(exec_list *instructions)
|
|||||||
/* We don't just do this above when we nuked a signature because of
|
/* We don't just do this above when we nuked a signature because of
|
||||||
* const pointers.
|
* const pointers.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(n, instructions) {
|
foreach_in_list_safe(ir_instruction, ir, instructions) {
|
||||||
ir_instruction *ir = (ir_instruction *) n;
|
|
||||||
ir_function *func = ir->as_function();
|
ir_function *func = ir->as_function();
|
||||||
|
|
||||||
if (func && func->signatures.is_empty()) {
|
if (func && func->signatures.is_empty()) {
|
||||||
|
@@ -341,8 +341,7 @@ ir_variable_replacement_visitor::visit_leave(ir_dereference_record *ir)
|
|||||||
ir_visitor_status
|
ir_visitor_status
|
||||||
ir_variable_replacement_visitor::visit_leave(ir_call *ir)
|
ir_variable_replacement_visitor::visit_leave(ir_call *ir)
|
||||||
{
|
{
|
||||||
foreach_list_safe(n, &ir->actual_parameters) {
|
foreach_in_list_safe(ir_rvalue, param, &ir->actual_parameters) {
|
||||||
ir_rvalue *param = (ir_rvalue *) n;
|
|
||||||
ir_rvalue *new_param = param;
|
ir_rvalue *new_param = param;
|
||||||
replace_rvalue(&new_param);
|
replace_rvalue(&new_param);
|
||||||
|
|
||||||
|
@@ -313,9 +313,7 @@ do_structure_splitting(exec_list *instructions)
|
|||||||
visit_list_elements(&refs, instructions);
|
visit_list_elements(&refs, instructions);
|
||||||
|
|
||||||
/* Trim out variables we can't split. */
|
/* Trim out variables we can't split. */
|
||||||
foreach_list_safe(n, &refs.variable_list) {
|
foreach_in_list_safe(variable_entry, entry, &refs.variable_list) {
|
||||||
variable_entry *entry = (variable_entry *) n;
|
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
printf("structure %s@%p: decl %d, whole_access %d\n",
|
printf("structure %s@%p: decl %d, whole_access %d\n",
|
||||||
entry->var->name, (void *) entry->var, entry->declaration,
|
entry->var->name, (void *) entry->var, entry->declaration,
|
||||||
@@ -335,8 +333,7 @@ do_structure_splitting(exec_list *instructions)
|
|||||||
/* Replace the decls of the structures to be split with their split
|
/* Replace the decls of the structures to be split with their split
|
||||||
* components.
|
* components.
|
||||||
*/
|
*/
|
||||||
foreach_list_safe(n, &refs.variable_list) {
|
foreach_in_list_safe(variable_entry, entry, &refs.variable_list) {
|
||||||
variable_entry *entry = (variable_entry *) n;
|
|
||||||
const struct glsl_type *type = entry->var->type;
|
const struct glsl_type *type = entry->var->type;
|
||||||
|
|
||||||
entry->mem_ctx = ralloc_parent(entry->var);
|
entry->mem_ctx = ralloc_parent(entry->var);
|
||||||
|
Reference in New Issue
Block a user