mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 20:40:09 +01: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") (cherry picked from commit537cc4e0ff) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38010>
This commit is contained in:
parent
ab7bda0a1b
commit
5dcc65643c
2 changed files with 4 additions and 2 deletions
|
|
@ -1024,7 +1024,7 @@
|
|||
"description": "nir/shrink_stores: Don't shrink stores to an invalid num_components.",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "2dba7e60567fe0b2742a0a4b4bba618123153757",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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