summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2019-07-30 22:23:02 +0200
committerBas Nieuwenhuizen <[email protected]>2019-07-30 22:33:24 +0200
commit2b53c49d2f7e54c4b3693abb0f13adf27d179ea8 (patch)
tree949fcdfb7d01d1cda81c01c23b529a20d8e300c0
parent2b71b4e79374ee0243de2d83409adab05ee71c69 (diff)
radv: Fix descriptor set allocation failure.
Set all the handles to VK_NULL_HANDLE: "If the creation of any of those descriptor sets fails, then the implementation must destroy all successfully created descriptor set objects from this command, set all entries of the pDescriptorSets array to VK_NULL_HANDLE and return the error." (Vulkan 1.1.117 Spec, section 13.2) CC: <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
-rw-r--r--src/amd/vulkan/radv_descriptor_set.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
index 7d3e6812b4e..6f999a4595b 100644
--- a/src/amd/vulkan/radv_descriptor_set.c
+++ b/src/amd/vulkan/radv_descriptor_set.c
@@ -796,9 +796,13 @@ VkResult radv_AllocateDescriptorSets(
pDescriptorSets[i] = radv_descriptor_set_to_handle(set);
}
- if (result != VK_SUCCESS)
+ if (result != VK_SUCCESS) {
radv_FreeDescriptorSets(_device, pAllocateInfo->descriptorPool,
i, pDescriptorSets);
+ for (i = 0; i < pAllocateInfo->descriptorSetCount; i++) {
+ pDescriptorSets[i] = VK_NULL_HANDLE;
+ }
+ }
return result;
}