X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fnir%2Fnir_lower_io_to_temporaries.c;h=301ba658921837467edae5906fffba2af5dbc0a9;hb=fc1d1dbe81e16041ec0d84811d171f7d42975eea;hp=8cbf6838ee889f80f561af22346e56c5eadb8cd2;hpb=8479b03c5826f32355775d865d99d69c829e65bb;p=mesa.git diff --git a/src/compiler/nir/nir_lower_io_to_temporaries.c b/src/compiler/nir/nir_lower_io_to_temporaries.c index 8cbf6838ee8..301ba658921 100644 --- a/src/compiler/nir/nir_lower_io_to_temporaries.c +++ b/src/compiler/nir/nir_lower_io_to_temporaries.c @@ -76,7 +76,7 @@ emit_copies(nir_cursor cursor, nir_shader *shader, struct exec_list *new_vars, static void emit_output_copies_impl(struct lower_io_state *state, nir_function_impl *impl) { - if (state->shader->stage == MESA_SHADER_GEOMETRY) { + if (state->shader->info.stage == MESA_SHADER_GEOMETRY) { /* For geometry shaders, we have to emit the output copies right * before each EmitVertex call. */ @@ -133,8 +133,7 @@ create_shadow_temp(struct lower_io_state *state, nir_variable *var) /* Reparent the name to the new variable */ ralloc_steal(nvar, nvar->name); - /* Reparent the constant initializer (if any) */ - ralloc_steal(nvar, nvar->constant_initializer); + assert(nvar->constant_initializer == NULL); /* Give the original a new name with @-temp appended */ const char *mode = (temp->data.mode == nir_var_shader_in) ? "in" : "out"; @@ -142,22 +141,22 @@ create_shadow_temp(struct lower_io_state *state, nir_variable *var) temp->data.mode = nir_var_global; temp->data.read_only = false; temp->data.fb_fetch_output = false; - temp->constant_initializer = NULL; + temp->data.compact = false; return nvar; } void -nir_lower_io_to_temporaries(nir_shader *shader, nir_function *entrypoint, +nir_lower_io_to_temporaries(nir_shader *shader, nir_function_impl *entrypoint, bool outputs, bool inputs) { struct lower_io_state state; - if (shader->stage == MESA_SHADER_TESS_CTRL) + if (shader->info.stage == MESA_SHADER_TESS_CTRL) return; state.shader = shader; - state.entrypoint = entrypoint->impl; + state.entrypoint = entrypoint; if (inputs) exec_list_move_nodes_to(&shader->inputs, &state.old_inputs);