vk/meta: Save/restore more stuff in cmd_buffer_restore
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 14 May 2015 00:34:37 +0000 (17:34 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 14 May 2015 05:22:59 +0000 (22:22 -0700)
src/vulkan/meta.c

index c346c3ef871a1b482a4a761f6e42fa54b59bb640..a10c21e84c501573689d7cec111d5dafeff87925 100644 (file)
@@ -161,24 +161,30 @@ struct anv_saved_state {
       struct anv_buffer *buffer;
       VkDeviceSize offset;
    } vb[2];
+   struct anv_descriptor_set *dsets[1];
    struct anv_pipeline *pipeline;
 };
 
 static void
-anv_cmd_buffer_save(struct anv_cmd_buffer *cmd_buffer, struct anv_saved_state *state)
+anv_cmd_buffer_save(struct anv_cmd_buffer *cmd_buffer,
+                    struct anv_saved_state *state)
 {
    memcpy(state->vb, cmd_buffer->vb, sizeof(state->vb));
+   memcpy(state->dsets, cmd_buffer->descriptor_sets, sizeof(state->dsets));
    state->pipeline = cmd_buffer->pipeline;
 }
 
 static void
-anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer, struct anv_saved_state *state)
+anv_cmd_buffer_restore(struct anv_cmd_buffer *cmd_buffer,
+                       const struct anv_saved_state *state)
 {
    memcpy(cmd_buffer->vb, state->vb, sizeof(state->vb));
+   memcpy(cmd_buffer->descriptor_sets, state->dsets, sizeof(state->dsets));
    cmd_buffer->pipeline = state->pipeline;
 
    cmd_buffer->vb_dirty |= (1 << ARRAY_SIZE(state->vb)) - 1;
-   cmd_buffer->dirty |= ANV_CMD_BUFFER_PIPELINE_DIRTY;
+   cmd_buffer->dirty |= ANV_CMD_BUFFER_PIPELINE_DIRTY |
+                        ANV_CMD_BUFFER_DESCRIPTOR_SET_DIRTY;
 }
 
 void