From 4aef5c62cd1b39ffb9ca26dffb18dc39444daf3a Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Wed, 19 Aug 2015 12:07:20 -0700 Subject: vk/meta: Restore all saved state in anv_cmd_buffer_restore() anv_cmd_buffer_restore() did not restore the old VkDynamicColorBlendState. --- src/vulkan/anv_meta.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/vulkan/anv_meta.c') diff --git a/src/vulkan/anv_meta.c b/src/vulkan/anv_meta.c index ff82fbe5b38..c3538f0e455 100644 --- a/src/vulkan/anv_meta.c +++ b/src/vulkan/anv_meta.c @@ -161,6 +161,7 @@ anv_cmd_buffer_save(struct anv_cmd_buffer *cmd_buffer, state->old_descriptor_set0 = cmd_buffer->state.descriptors[0].set; memcpy(state->old_vertex_bindings, cmd_buffer->state.vertex_bindings, sizeof(state->old_vertex_bindings)); + state->old_cb_state = cmd_buffer->state.cb_state; } static void @@ -175,6 +176,11 @@ anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer, cmd_buffer->state.vb_dirty |= (1 << NUM_VB_USED) - 1; cmd_buffer->state.dirty |= ANV_CMD_BUFFER_PIPELINE_DIRTY; cmd_buffer->state.descriptors_dirty |= VK_SHADER_STAGE_VERTEX_BIT; + + if (cmd_buffer->state.cb_state != state->old_cb_state) { + cmd_buffer->state.cb_state = state->old_cb_state; + cmd_buffer->state.dirty |= ANV_CMD_BUFFER_CB_DIRTY; + } } struct vue_header { @@ -504,7 +510,6 @@ meta_prepare_blit(struct anv_cmd_buffer *cmd_buffer, anv_CmdBindDynamicDepthStencilState(anv_cmd_buffer_to_handle(cmd_buffer), device->meta_state.shared.ds_state); - saved_state->old_cb_state = cmd_buffer->state.cb_state; anv_CmdBindDynamicColorBlendState(anv_cmd_buffer_to_handle(cmd_buffer), device->meta_state.shared.cb_state); } @@ -705,9 +710,6 @@ meta_finish_blit(struct anv_cmd_buffer *cmd_buffer, const struct anv_saved_state *saved_state) { anv_cmd_buffer_restore(cmd_buffer, saved_state); - anv_CmdBindDynamicColorBlendState( - anv_cmd_buffer_to_handle(cmd_buffer), - anv_dynamic_cb_state_to_handle(saved_state->old_cb_state)); } static VkFormat -- cgit v1.2.3