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: 169e03800d ("tu: Implement VK_EXT_color_write_enable")
Fixes: #7328
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18956>
(cherry picked from commit dadb29cf2e)
This commit is contained in:
Emma Anholt
2022-10-04 10:15:00 -07:00
committed by Dylan Baker
parent 7173cb4f43
commit c66624f59b
2 changed files with 4 additions and 5 deletions

View File

@@ -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"
},

View File

@@ -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 |