radv: fix descriptor pool allocation size
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 14 Sep 2018 12:56:38 +0000 (14:56 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 17 Sep 2018 08:18:01 +0000 (10:18 +0200)
The size has to be multiplied by the number of sets.

This gets rid of the OUT_OF_POOL_KHR error and fixes
a crash with the Tangrams demo.

CC: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_descriptor_set.c

index c4341f6ac52288b0f38918f1d302978f04b58767..49d0811bb06e9dd352ccb7dbd5f5f53895257494 100644 (file)
@@ -569,9 +569,10 @@ VkResult radv_CreateDescriptorPool(
        }
 
        if (!(pCreateInfo->flags & VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT)) {
-               uint64_t host_size = pCreateInfo->maxSets * sizeof(struct radv_descriptor_set);
+               uint64_t host_size = sizeof(struct radv_descriptor_set);
                host_size += sizeof(struct radeon_winsys_bo*) * bo_count;
                host_size += sizeof(struct radv_descriptor_range) * range_count;
+               host_size *= pCreateInfo->maxSets;
                size += host_size;
        } else {
                size += sizeof(struct radv_descriptor_pool_entry) * pCreateInfo->maxSets;