From 600a48248e9d74c6ade7030a5b14dbc6778d98e6 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 15 Apr 2021 18:20:58 -0400 Subject: [PATCH] panfrost: Invert blend_reads_dest logic Easier to understand (and match to actual hardware behaviour) this way. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 86624e894fd..36b4c5a8e47 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -448,11 +448,11 @@ panfrost_prepare_bifrost_fs_state(struct panfrost_context *ctx, fs->bo ? fs->bo->ptr.gpu : 0, state); - bool no_blend = true; + bool blend_reads_dest = false; for (unsigned i = 0; i < ctx->pipe_framebuffer.nr_cbufs; ++i) { - no_blend &= (!blend[i].load_dest || blend[i].no_colour) - || (!ctx->pipe_framebuffer.cbufs[i]); + blend_reads_dest |= (blend[i].load_dest && + ctx->pipe_framebuffer.cbufs[i]); } state->properties.bifrost.allow_forward_pixel_to_kill = @@ -462,7 +462,7 @@ panfrost_prepare_bifrost_fs_state(struct panfrost_context *ctx, !fs->info.fs.can_discard && !fs->info.fs.outputs_read && !alpha_to_coverage && - no_blend; + !blend_reads_dest; } }