vk/meta: Restore all saved state in anv_cmd_buffer_restore()
authorChad Versace <chad.versace@intel.com>
Wed, 19 Aug 2015 19:07:20 +0000 (12:07 -0700)
committerChad Versace <chad.versace@intel.com>
Thu, 20 Aug 2015 16:30:34 +0000 (09:30 -0700)
anv_cmd_buffer_restore() did not restore the old
VkDynamicColorBlendState.

src/vulkan/anv_meta.c

index ff82fbe5b3853cd233d718ff2465605a7054d883..c3538f0e455edd63fc7dd944a40fc52cc2f04727 100644 (file)
@@ -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