mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
nir/lower_blend: Optimize out PIPE_LOGICOP_NOOP
Just drop the store. Written while debugging dEQP-VK.pipeline.monolithic.logic_op.r8_uint.no_op. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Italo Nicola <italonicola@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24252>
This commit is contained in:
parent
9c0740211d
commit
6619317172
1 changed files with 4 additions and 2 deletions
|
|
@ -280,7 +280,7 @@ nir_logicop_func(
|
|||
case PIPE_LOGICOP_EQUIV:
|
||||
return nir_ixor(b, nir_ixor(b, src, dst), bitmask);
|
||||
case PIPE_LOGICOP_NOOP:
|
||||
return dst;
|
||||
unreachable("optimized out");
|
||||
case PIPE_LOGICOP_OR_INVERTED:
|
||||
return nir_ior(b, nir_ixor(b, src, bitmask), dst);
|
||||
case PIPE_LOGICOP_COPY:
|
||||
|
|
@ -531,7 +531,9 @@ nir_lower_blend_instr(nir_builder *b, nir_instr *instr, void *data)
|
|||
b->cursor = nir_after_block(instr->block);
|
||||
|
||||
/* Don't bother copying the destination to the source for disabled RTs */
|
||||
if (options->rt[rt].colormask == 0) {
|
||||
if (options->rt[rt].colormask == 0 ||
|
||||
(options->logicop_enable && options->logicop_func == PIPE_LOGICOP_NOOP)) {
|
||||
|
||||
nir_instr_remove(instr);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue