mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 21:40:08 +01:00
glsl: Skip processing the first function's body in do_dead_functions().
It can't call anything, so there's no point.
This commit is contained in:
parent
11af045ea8
commit
c75427f4c8
1 changed files with 10 additions and 1 deletions
|
|
@ -50,6 +50,7 @@ public:
|
|||
ir_dead_functions_visitor()
|
||||
{
|
||||
this->mem_ctx = ralloc_context(NULL);
|
||||
this->seen_another_function_signature = false;
|
||||
}
|
||||
|
||||
~ir_dead_functions_visitor()
|
||||
|
|
@ -64,6 +65,8 @@ public:
|
|||
|
||||
bool (*predicate)(ir_instruction *ir);
|
||||
|
||||
bool seen_another_function_signature;
|
||||
|
||||
/* List of signature_entry */
|
||||
exec_list signature_list;
|
||||
void *mem_ctx;
|
||||
|
|
@ -94,7 +97,13 @@ ir_dead_functions_visitor::visit_enter(ir_function_signature *ir)
|
|||
entry->used = true;
|
||||
}
|
||||
|
||||
|
||||
/* If this is the first signature to look at, no need to descend to see
|
||||
* if it has calls to another function signature.
|
||||
*/
|
||||
if (!this->seen_another_function_signature) {
|
||||
this->seen_another_function_signature = true;
|
||||
return visit_continue_with_parent;
|
||||
}
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue