From c66624f59b08fa21a939e5a6a791c41c3d735ec4 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 4 Oct 2022 10:15:00 -0700 Subject: [PATCH] turnip: Don't use the dynamic color write enable during non-dynamic. We have the correct merged color write enable state as a local var here, use that instead of the zero cmd->state.color_write_enable. Fixes blending in many traces with ANGLE on turnip. In the process of fixing, clarify the logic a little bit. Fixes: 169e03800d0f ("tu: Implement VK_EXT_color_write_enable") Fixes: #7328 Part-of: (cherry picked from commit dadb29cf2e21ba6b28a2d9ac62dd4ff13f7df9a2) --- .pick_status.json | 2 +- src/freedreno/vulkan/tu_cmd_buffer.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 0e23fcbb558..caa15f829a6 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1318,7 +1318,7 @@ "description": "turnip: Don't use the dynamic color write enable during non-dynamic.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "169e03800d0f0e8b66999bd2cf13d40ae4f6e782" }, diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index 32a57c4f6e5..4109ef211b6 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -4341,10 +4341,9 @@ tu6_emit_blend(struct tu_cs *cs, struct tu_cmd_buffer *cmd) } } - uint32_t blend_enable_mask = - (cmd->state.logic_op_enabled && cmd->state.rop_reads_dst) ? - color_write_enable : (cmd->state.pipeline_blend_enable & - cmd->state.color_write_enable); + uint32_t blend_enable_mask = color_write_enable; + if (!(cmd->state.logic_op_enabled && cmd->state.rop_reads_dst)) + blend_enable_mask &= cmd->state.pipeline_blend_enable; tu_cs_emit_pkt4(cs, REG_A6XX_SP_BLEND_CNTL, 1); tu_cs_emit(cs, cmd->state.sp_blend_cntl |