mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
glsl: Remove const decoration from inlined function parameters
The constness of the function parameter gets inlined with the rest of the function. However, there is also an assignment to the parameter. If this occurs inside a loop the loop analysis code will get confused by the assignment to a read-only variable. Fixes bugzilla #30552. NOTE: this is a candidate for the 7.9 branch.
This commit is contained in:
parent
dc459f8756
commit
0ea8b99332
1 changed files with 7 additions and 0 deletions
|
|
@ -153,6 +153,13 @@ ir_call::generate_inline(ir_instruction *next_ir)
|
|||
} else {
|
||||
parameters[i] = sig_param->clone(ctx, ht);
|
||||
parameters[i]->mode = ir_var_auto;
|
||||
|
||||
/* Remove the read-only decoration becuase we're going to write
|
||||
* directly to this variable. If the cloned variable is left
|
||||
* read-only and the inlined function is inside a loop, the loop
|
||||
* analysis code will get confused.
|
||||
*/
|
||||
parameters[i]->read_only = false;
|
||||
next_ir->insert_before(parameters[i]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue