mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 05:58:05 +02:00
nir/lower_returns: Stop using constant initializers
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
507626304c
commit
257aa5a1c4
1 changed files with 5 additions and 4 deletions
|
|
@ -147,17 +147,18 @@ lower_returns_in_block(nir_block *block, struct lower_returns_state *state)
|
|||
nir_instr_remove(&jump->instr);
|
||||
|
||||
nir_builder *b = &state->builder;
|
||||
b->cursor = nir_after_block(block);
|
||||
|
||||
/* Set the return flag */
|
||||
if (state->return_flag == NULL) {
|
||||
state->return_flag =
|
||||
nir_local_variable_create(b->impl, glsl_bool_type(), "return");
|
||||
|
||||
/* Set a default value of false */
|
||||
state->return_flag->constant_initializer =
|
||||
rzalloc(state->return_flag, nir_constant);
|
||||
/* Initialize the variable to 0 */
|
||||
b->cursor = nir_before_cf_list(&b->impl->body);
|
||||
nir_store_var(b, state->return_flag, nir_imm_int(b, NIR_FALSE), 1);
|
||||
}
|
||||
|
||||
b->cursor = nir_after_block(block);
|
||||
nir_store_var(b, state->return_flag, nir_imm_int(b, NIR_TRUE), 1);
|
||||
|
||||
if (state->loop) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue