Module: Mesa Branch: staging/22.1 Commit: 691a051d7defd3687c71974e5f5f083b37f9ed16 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=691a051d7defd3687c71974e5f5f083b37f9ed16
Author: Rob Clark <[email protected]> Date: Fri Jul 1 16:36:43 2022 -0700 freedreno/ir3: Add copy_vars() helper Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341> (cherry picked from commit 1fdddb142480ed8045c709a3b7d3cfd2c9631de2) --- .pick_status.json | 2 +- src/freedreno/ir3/ir3_nir_lower_tess.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index a74d29d2e20..33f180ff440 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7699,7 +7699,7 @@ "description": "freedreno/ir3: Add copy_vars() helper", "nominated": false, "nomination_type": null, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/freedreno/ir3/ir3_nir_lower_tess.c b/src/freedreno/ir3/ir3_nir_lower_tess.c index 7ce254513a5..1ba39619ebd 100644 --- a/src/freedreno/ir3/ir3_nir_lower_tess.c +++ b/src/freedreno/ir3/ir3_nir_lower_tess.c @@ -833,6 +833,16 @@ ir3_nir_lower_tess_eval(nir_shader *shader, struct ir3_shader_variant *v, nir_metadata_preserve(impl, nir_metadata_none); } +static void +copy_vars(nir_builder *b, struct exec_list *dests, struct exec_list *srcs) +{ + foreach_two_lists (dest_node, dests, src_node, srcs) { + nir_variable *dest = exec_node_data(nir_variable, dest_node, node); + nir_variable *src = exec_node_data(nir_variable, src_node, node); + nir_copy_var(b, dest, src); + } +} + static void lower_gs_block(nir_block *block, nir_builder *b, struct state *state) { @@ -869,12 +879,7 @@ lower_gs_block(nir_block *block, nir_builder *b, struct state *state) nir_imm_int(b, stream)), 0x1 /* .x */); - foreach_two_lists (dest_node, &state->emit_outputs, src_node, - &state->old_outputs) { - nir_variable *dest = exec_node_data(nir_variable, dest_node, node); - nir_variable *src = exec_node_data(nir_variable, src_node, node); - nir_copy_var(b, dest, src); - } + copy_vars(b, &state->emit_outputs, &state->old_outputs); nir_instr_remove(&intr->instr); @@ -988,12 +993,7 @@ ir3_nir_lower_gs(nir_shader *shader) nir_discard_if(&b, cond); - foreach_two_lists (dest_node, &state.new_outputs, src_node, - &state.emit_outputs) { - nir_variable *dest = exec_node_data(nir_variable, dest_node, node); - nir_variable *src = exec_node_data(nir_variable, src_node, node); - nir_copy_var(&b, dest, src); - } + copy_vars(&b, &state.new_outputs, &state.emit_outputs); } exec_list_append(&shader->variables, &state.old_outputs);
