mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-26 23:18:12 +02:00
ac/nir/lower_tex_coords: fix optimizing cube txd to tex
We need to remove ddx/ddy before doing the cube lowering,
otherwise we insert instructions that break dominance.
Affects Sable.
Fixes: 7d552d71e9 ("ac/nir: optimize txd(coord, ddx/ddy(coord))")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41489>
This commit is contained in:
parent
6b3223895f
commit
d256c1f49e
1 changed files with 4 additions and 2 deletions
|
|
@ -442,6 +442,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);
|
||||
|
|
@ -455,8 +459,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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue