Module: Mesa Branch: 23.0 Commit: 7dd8437e096de2065da5d9f14d26a3daa11ff7f1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7dd8437e096de2065da5d9f14d26a3daa11ff7f1
Author: Alyssa Rosenzweig <[email protected]> Date: Thu Jan 12 17:34:44 2023 -0500 panfrost: Fix logic ops on Bifrost opaque should not be set when logicops are enabled, that needs blending even on Bifrost. Fixes is for when I believe the bug became possible to hit. The logical error is older. Fixes Piglit logicop tests again. Fixes: d849d9779a7 ("panfrost: Avoid blend shader when not blending") Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20685> (cherry picked from commit 41d99c10d1f2dff160b732e5311da398eb1ed90a) --- .pick_status.json | 2 +- src/gallium/drivers/panfrost/pan_cmdstream.c | 2 +- src/panfrost/lib/pan_blend.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index b2c3e857d61..4cdae650b95 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -580,7 +580,7 @@ "description": "panfrost: Fix logic ops on Bifrost", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "d849d9779a77f05d7acd418516e154a4e9018f40" }, diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 53534de041b..2f567e96d8a 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -4209,7 +4209,7 @@ panfrost_create_blend_state(struct pipe_context *pipe, const bool supports_2src = pan_blend_supports_2src(PAN_ARCH); so->info[c] = (struct pan_blend_info){ .enabled = (equation.color_mask != 0), - .opaque = pan_blend_is_opaque(equation), + .opaque = !blend->logicop_enable && pan_blend_is_opaque(equation), .constant_mask = constant_mask, /* TODO: check the dest for the logicop */ diff --git a/src/panfrost/lib/pan_blend.c b/src/panfrost/lib/pan_blend.c index 768f49f720e..abd3aad9efa 100644 --- a/src/panfrost/lib/pan_blend.c +++ b/src/panfrost/lib/pan_blend.c @@ -796,7 +796,8 @@ GENX(pan_blend_get_shader_locked)(const struct panfrost_device *dev, }; /* Blend shaders should only be used for blending on Bifrost onwards */ - assert(dev->arch <= 5 || !pan_blend_is_opaque(state->rts[rt].equation)); + assert(dev->arch <= 5 || state->logicop_enable || + !pan_blend_is_opaque(state->rts[rt].equation)); assert(state->rts[rt].equation.color_mask != 0); struct hash_entry *he =
