radv: zero the bo descriptor array when allocating a new set
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 3 Feb 2021 12:17:17 +0000 (07:17 -0500)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sat, 6 Feb 2021 02:02:17 +0000 (21:02 -0500)
this must be reset to avoid issues when using VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT_EXT
when some descriptors in the set may not have been bound

fixes #4219

Fixes: 126d5adb11e ("radv: Use host memory pool for non-freeable descriptors.")

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8840>

src/amd/vulkan/radv_descriptor_set.c

index 9e8794a..a7dd239 100644 (file)
@@ -574,6 +574,7 @@ radv_descriptor_set_create(struct radv_device *device,
 
                set = (struct radv_descriptor_set*)pool->host_memory_ptr;
                pool->host_memory_ptr += mem_size;
+               memset(set->descriptors, 0, sizeof(struct radeon_winsys_bo *) * buffer_count);
        } else {
                set = vk_alloc2(&device->vk.alloc, NULL, mem_size, 8,
                                VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);