mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
nir/lower_blend: Shrink blended result if needed
Make sure the new and old sources have the same number of components, otherwise the NIR validation pass complains. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13060>
This commit is contained in:
parent
3e07b8d4f8
commit
7cd402c9c8
1 changed files with 3 additions and 0 deletions
|
|
@ -374,6 +374,9 @@ nir_lower_blend_instr(nir_builder *b, nir_instr *instr, void *data)
|
|||
/* Apply a colormask */
|
||||
blended = nir_color_mask(b, options->rt[rt].colormask, blended, dst);
|
||||
|
||||
if (src_num_comps != 4)
|
||||
blended = nir_channels(b, blended, BITFIELD_MASK(src_num_comps));
|
||||
|
||||
/* Write out the final color instead of the input */
|
||||
nir_instr_rewrite_src_ssa(instr, &intr->src[1], blended);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue