radv/meta: do not restore a NULL descriptor
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 10 Jul 2018 14:13:40 +0000 (16:13 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 12 Jul 2018 09:08:45 +0000 (11:08 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta.c

index 00a20d155e72d20209a3dbcf7439f2f6e0c40636..a59f38fb21d3018a9a96c47ea50276c9e6fb69dd 100644 (file)
@@ -80,10 +80,9 @@ radv_meta_save(struct radv_meta_saved_state *state,
        }
 
        if (state->flags & RADV_META_SAVE_DESCRIPTORS) {
-               if (descriptors_state->valid & (1 << 0))
-                       state->old_descriptor_set0 = descriptors_state->sets[0];
-               else
-                       state->old_descriptor_set0 = NULL;
+               state->old_descriptor_set0 = descriptors_state->sets[0];
+               if (!state->old_descriptor_set0)
+                       state->flags &= ~RADV_META_SAVE_DESCRIPTORS;
        }
 
        if (state->flags & RADV_META_SAVE_CONSTANTS) {