Mesa (staging/19.1): radv: Fix descriptor set allocation failure.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 31 08:20:47 UTC 2019


Module: Mesa
Branch: staging/19.1
Commit: b1d66aa9ee44ccdd1ca4a4bd6f5e3be3bd9743b3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1d66aa9ee44ccdd1ca4a4bd6f5e3be3bd9743b3

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Tue Jul 30 22:23:02 2019 +0200

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: <mesa-stable at lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied at redhat.com>
(cherry picked from commit 2b53c49d2f7e54c4b3693abb0f13adf27d179ea8)

---

 src/amd/vulkan/radv_descriptor_set.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c
index 89d451cd728..33615af9784 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;
 }
 




More information about the mesa-commit mailing list