Mesa (main): lavapipe: zero out blend info if blend isn't enabled
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jun 24 00:28:19 UTC 2022
Module: Mesa
Branch: main
Commit: 3aaab4a232cbd377ac6e22295f70d41be4a9c56e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3aaab4a232cbd377ac6e22295f70d41be4a9c56e
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Wed Jun 22 17:06:25 2022 -0400
lavapipe: zero out blend info if blend isn't enabled
this makes reading traces easier
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17219>
---
src/gallium/frontends/lavapipe/lvp_execute.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c
index 98e9c54738f..f9358fc0755 100644
--- a/src/gallium/frontends/lavapipe/lvp_execute.c
+++ b/src/gallium/frontends/lavapipe/lvp_execute.c
@@ -759,12 +759,21 @@ static void handle_graphics_pipeline(struct vk_cmd_queue_entry *cmd,
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;
- state->blend_state.rt[i].rgb_func = vk_conv_blend_func(cb->pAttachments[i].colorBlendOp);
- state->blend_state.rt[i].rgb_src_factor = vk_conv_blend_factor(cb->pAttachments[i].srcColorBlendFactor);
- state->blend_state.rt[i].rgb_dst_factor = vk_conv_blend_factor(cb->pAttachments[i].dstColorBlendFactor);
- state->blend_state.rt[i].alpha_func = vk_conv_blend_func(cb->pAttachments[i].alphaBlendOp);
- state->blend_state.rt[i].alpha_src_factor = vk_conv_blend_factor(cb->pAttachments[i].srcAlphaBlendFactor);
- state->blend_state.rt[i].alpha_dst_factor = vk_conv_blend_factor(cb->pAttachments[i].dstAlphaBlendFactor);
+ if (state->blend_state.rt[i].blend_enable) {
+ state->blend_state.rt[i].rgb_func = vk_conv_blend_func(cb->pAttachments[i].colorBlendOp);
+ state->blend_state.rt[i].rgb_src_factor = vk_conv_blend_factor(cb->pAttachments[i].srcColorBlendFactor);
+ state->blend_state.rt[i].rgb_dst_factor = vk_conv_blend_factor(cb->pAttachments[i].dstColorBlendFactor);
+ state->blend_state.rt[i].alpha_func = vk_conv_blend_func(cb->pAttachments[i].alphaBlendOp);
+ state->blend_state.rt[i].alpha_src_factor = vk_conv_blend_factor(cb->pAttachments[i].srcAlphaBlendFactor);
+ state->blend_state.rt[i].alpha_dst_factor = vk_conv_blend_factor(cb->pAttachments[i].dstAlphaBlendFactor);
+ } else {
+ state->blend_state.rt[i].rgb_func = 0;
+ state->blend_state.rt[i].rgb_src_factor = 0;
+ state->blend_state.rt[i].rgb_dst_factor = 0;
+ state->blend_state.rt[i].alpha_func = 0;
+ state->blend_state.rt[i].alpha_src_factor = 0;
+ state->blend_state.rt[i].alpha_dst_factor = 0;
+ }
/* At least llvmpipe applies the blend factor prior to the blend function,
* regardless of what function is used. (like i965 hardware).
More information about the mesa-commit
mailing list