radv: Save descriptor set even if vertex buffers are not saved.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 13 May 2017 16:05:36 +0000 (18:05 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 13 May 2017 21:05:25 +0000 (23:05 +0200)
Totally independent.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes: 0e6d532d327 "radv/meta: add support for save/restore meta without vertex data."
src/amd/vulkan/radv_meta.c

index 973316103aa842636759cf2a951cba4f27521b41..4f359bd6a9d9436f71fc6e0f3e9446aa1b9568ea 100644 (file)
@@ -36,6 +36,7 @@ radv_meta_save_novertex(struct radv_meta_saved_state *state,
               uint32_t dynamic_mask)
 {
        state->old_pipeline = cmd_buffer->state.pipeline;
+       state->old_descriptor_set0 = cmd_buffer->state.descriptors[0];
 
        state->dynamic_mask = dynamic_mask;
        radv_dynamic_state_copy(&state->dynamic, &cmd_buffer->state.dynamic,
@@ -50,9 +51,9 @@ radv_meta_restore(const struct radv_meta_saved_state *state,
                  struct radv_cmd_buffer *cmd_buffer)
 {
        cmd_buffer->state.pipeline = state->old_pipeline;
+       cmd_buffer->state.descriptors[0] = state->old_descriptor_set0;
+       cmd_buffer->state.descriptors_dirty |= (1u << 0);
        if (state->vertex_saved) {
-               cmd_buffer->state.descriptors[0] = state->old_descriptor_set0;
-               cmd_buffer->state.descriptors_dirty |= (1u << 0);
                memcpy(cmd_buffer->state.vertex_bindings, state->old_vertex_bindings,
                       sizeof(state->old_vertex_bindings));
                cmd_buffer->state.vb_dirty |= (1 << RADV_META_VERTEX_BINDING_COUNT) - 1;