mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 09:00:10 +01:00
nir/lower_blend: Optimize masked out RTs
While debugging KHR-GLES31.core.draw_buffers_indexed.color_masks, the noise from piles of store_output(load_output) instructions got in the way. Optimize it out. This does not fix the test, but if this case ever happened in a real app it would improve performance. This is only load bearing on Asahi (and PanVK?), since Panfrost wouldn't call nir_lower_blend at all in this case. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23836>
This commit is contained in:
parent
d4424950ac
commit
c24b753378
1 changed files with 6 additions and 0 deletions
|
|
@ -515,6 +515,12 @@ 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) {
|
||||
nir_instr_remove(instr);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Grab the input color. We always want 4 channels during blend. Dead
|
||||
* code will clean up any channels we don't need.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue