From 2b14a7658a4c798564d5269541b833975ad9d950 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 9 Jun 2022 17:48:43 -0600 Subject: [PATCH] lavapipe: fix logicop, independent blend enable/disable The logicop_enable and independent_blend_enable vars need to always be assigned, otherwise, once turned on, they could never be disabled. This fixes a number of failures in VMware's test suite. Signed-off-by: Brian Paul Reviewed-By: Mike Blumenkrantz Reviewed-by: Roland Scheidegger cc: mesa-stable Part-of: --- src/gallium/frontends/lavapipe/lvp_execute.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index 26a39bbc9f1..ff9c603daf8 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -748,14 +748,14 @@ static void handle_graphics_pipeline(struct vk_cmd_queue_entry *cmd, const VkPipelineColorBlendStateCreateInfo *cb = pipeline->graphics_create_info.pColorBlendState; int i; + state->blend_state.logicop_enable = cb->logicOpEnable; if (cb->logicOpEnable) { - state->blend_state.logicop_enable = VK_TRUE; if (!dynamic_states[conv_dynamic_state_idx(VK_DYNAMIC_STATE_LOGIC_OP_EXT)]) state->blend_state.logicop_func = vk_conv_logic_op(cb->logicOp); } - if (cb->attachmentCount > 1) - state->blend_state.independent_blend_enable = true; + state->blend_state.independent_blend_enable = (cb->attachmentCount > 1); + for (i = 0; i < cb->attachmentCount; i++) { state->blend_state.rt[i].colormask = cb->pAttachments[i].colorWriteMask; state->blend_state.rt[i].blend_enable = cb->pAttachments[i].blendEnable;