vk/meta: Save/restore VkDynamicDepthStencilState
authorChad Versace <chad.versace@intel.com>
Fri, 28 Aug 2015 14:59:29 +0000 (07:59 -0700)
committerChad Versace <chad.versace@intel.com>
Fri, 28 Aug 2015 14:59:29 +0000 (07:59 -0700)
src/vulkan/anv_meta.c

index 201e3da41b3c40b64f8004b5560d15afada301a3..63d9b3f3e477d01aa5fac28c0bb1bd06f50433ec 100644 (file)
@@ -198,6 +198,7 @@ struct anv_saved_state {
    struct anv_vertex_binding old_vertex_bindings[NUM_VB_USED];
    struct anv_descriptor_set *old_descriptor_set0;
    struct anv_pipeline *old_pipeline;
+   struct anv_dynamic_ds_state *old_ds_state;
    struct anv_dynamic_cb_state *old_cb_state;
 };
 
@@ -209,6 +210,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_ds_state = cmd_buffer->state.ds_state;
    state->old_cb_state = cmd_buffer->state.cb_state;
 }
 
@@ -225,6 +227,11 @@ anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer,
    cmd_buffer->state.dirty |= ANV_CMD_BUFFER_PIPELINE_DIRTY;
    cmd_buffer->state.descriptors_dirty |= VK_SHADER_STAGE_VERTEX_BIT;
 
+   if (cmd_buffer->state.ds_state != state->old_ds_state) {
+      cmd_buffer->state.ds_state = state->old_ds_state;
+      cmd_buffer->state.dirty |= ANV_CMD_BUFFER_DS_DIRTY;
+   }
+
    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;