Home | History | Annotate | Download | only in nir

Lines Matching refs:state

77 emit_output_copies_impl(struct lower_io_state *state, nir_function_impl *impl)
79 if (state->shader->stage == MESA_SHADER_GEOMETRY) {
91 emit_copies(cursor, state->shader, &state->shader->outputs,
92 &state->old_outputs);
96 } else if (impl == state->entrypoint) {
98 emit_copies(cursor, state->shader, &state->old_outputs,
99 &state->shader->outputs);
108 emit_copies(cursor, state->shader, &state->shader->outputs,
109 &state->old_outputs);
115 emit_input_copies_impl(struct lower_io_state *state, nir_function_impl *impl)
117 if (impl == state->entrypoint) {
119 emit_copies(cursor, state->shader, &state->old_inputs,
120 &state->shader->inputs);
125 create_shadow_temp(struct lower_io_state *state, nir_variable *var)
127 nir_variable *nvar = ralloc(state->shader, nir_variable);
152 struct lower_io_state state;
157 state.shader = shader;
158 state.entrypoint = entrypoint;
161 exec_list_move_nodes_to(&shader->inputs, &state.old_inputs);
163 exec_list_make_empty(&state.old_inputs);
166 exec_list_move_nodes_to(&shader->outputs, &state.old_outputs);
168 exec_list_make_empty(&state.old_outputs);
173 nir_foreach_variable(var, &state.old_outputs) {
174 nir_variable *output = create_shadow_temp(&state, var);
179 nir_foreach_variable(var, &state.old_inputs) {
180 nir_variable *input = create_shadow_temp(&state, var);
189 emit_input_copies_impl(&state, function->impl);
192 emit_output_copies_impl(&state, function->impl);
198 exec_list_append(&shader->globals, &state.old_inputs);
199 exec_list_append(&shader->globals, &state.old_outputs);