mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
nir/shrink_stores: Don't shrink stores to an invalid num_components.
Avoids a regression in the CL CTS on the next commit.
Fixes: 2dba7e6056 ("nir: split nir_opt_shrink_stores from nir_opt_shrink_vectors")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37313>
This commit is contained in:
parent
aea949dd29
commit
537cc4e0ff
1 changed files with 3 additions and 1 deletions
|
|
@ -82,7 +82,9 @@ opt_shrink_store_instr(nir_builder *b, nir_intrinsic_instr *instr, bool shrink_i
|
|||
|
||||
/* Trim the num_components stored according to the write mask. */
|
||||
unsigned write_mask = nir_intrinsic_write_mask(instr);
|
||||
unsigned last_bit = util_last_bit(write_mask);
|
||||
/* Don't trim down to an invalid number of components, though. */
|
||||
unsigned last_bit = nir_round_up_components(util_last_bit(write_mask));
|
||||
|
||||
if (last_bit < instr->num_components) {
|
||||
nir_def *def = nir_trim_vector(b, instr->src[0].ssa, last_bit);
|
||||
nir_src_rewrite(&instr->src[0], def);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue