diff --git a/.pick_status.json b/.pick_status.json index e270118fac6..098d175db06 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -304,7 +304,7 @@ "description": "ac/nir/lower_tex_coords: fix optimizing cube txd to tex", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "7d552d71e94b3080eb569b3fa6763ab905d98b7a", "notes": null diff --git a/src/amd/common/nir/ac_nir_lower_tex.c b/src/amd/common/nir/ac_nir_lower_tex.c index 63713eece4f..317c6c68bf7 100644 --- a/src/amd/common/nir/ac_nir_lower_tex.c +++ b/src/amd/common/nir/ac_nir_lower_tex.c @@ -419,6 +419,10 @@ move_tex_coords(struct move_tex_coords_state *state, nir_function_impl *impl, ni components[i] = nir_get_scalar(build_coordinate(state, components[i], infos[i]), 0); nir_def *linear_vgpr = nir_vec_scalars(&state->toplevel_b, components, tex->coord_components); + + /* This must be done before lowering tex coords because of cubes. */ + optimize_txd(tex); + lower_tex_coords(&state->toplevel_b, tex, &linear_vgpr, state->options); linear_vgpr = nir_strict_wqm_coord_amd(&state->toplevel_b, linear_vgpr, coord_base * 4); @@ -432,8 +436,6 @@ move_tex_coords(struct move_tex_coords_state *state, nir_function_impl *impl, ni if (offset_src >= 0) /* Workaround requirement in nir_tex_instr_src_size(). */ tex->src[offset_src].src_type = nir_tex_src_backend2; - optimize_txd(tex); - state->num_wqm_vgprs += linear_vgpr_size; return true;