radv: copy custom blend mode to the cmdbuf state

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
This commit is contained in:
Samuel Pitoiset
2023-03-22 16:11:46 +01:00
committed by Marge Bot
parent bc39fa9500
commit b0a007583d
2 changed files with 8 additions and 4 deletions

View File

@@ -2345,7 +2345,6 @@ radv_is_mrt0_dual_src(struct radv_cmd_buffer *cmd_buffer)
static void static void
radv_emit_logic_op(struct radv_cmd_buffer *cmd_buffer) radv_emit_logic_op(struct radv_cmd_buffer *cmd_buffer)
{ {
const struct radv_graphics_pipeline *pipeline = cmd_buffer->state.graphics_pipeline;
const struct radv_dynamic_state *d = &cmd_buffer->state.dynamic; const struct radv_dynamic_state *d = &cmd_buffer->state.dynamic;
unsigned cb_color_control = 0; unsigned cb_color_control = 0;
@@ -2361,11 +2360,11 @@ radv_emit_logic_op(struct radv_cmd_buffer *cmd_buffer)
cb_color_control |= cb_color_control |=
S_028808_DISABLE_DUAL_QUAD(mrt0_is_dual_src || d->vk.cb.logic_op_enable || S_028808_DISABLE_DUAL_QUAD(mrt0_is_dual_src || d->vk.cb.logic_op_enable ||
pipeline->custom_blend_mode == V_028808_CB_RESOLVE); cmd_buffer->state.custom_blend_mode == V_028808_CB_RESOLVE);
} }
if (pipeline->custom_blend_mode) { if (cmd_buffer->state.custom_blend_mode) {
cb_color_control |= S_028808_MODE(pipeline->custom_blend_mode); cb_color_control |= S_028808_MODE(cmd_buffer->state.custom_blend_mode);
} else { } else {
bool color_write_enabled = false; bool color_write_enabled = false;
@@ -6565,6 +6564,8 @@ radv_CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipeline
cmd_buffer->scratch_waves_wanted = MAX2(cmd_buffer->scratch_waves_wanted, pipeline->max_waves); cmd_buffer->scratch_waves_wanted = MAX2(cmd_buffer->scratch_waves_wanted, pipeline->max_waves);
radv_bind_multisample_state(cmd_buffer, &graphics_pipeline->ms); radv_bind_multisample_state(cmd_buffer, &graphics_pipeline->ms);
cmd_buffer->state.custom_blend_mode = graphics_pipeline->custom_blend_mode;
break; break;
} }
default: default:

View File

@@ -1697,6 +1697,9 @@ struct radv_cmd_state {
unsigned last_pa_sc_binner_cntl_0; unsigned last_pa_sc_binner_cntl_0;
struct radv_multisample_state ms; struct radv_multisample_state ms;
/* Custom blend mode for internal operations. */
unsigned custom_blend_mode;
}; };
struct radv_cmd_buffer_upload { struct radv_cmd_buffer_upload {