mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 09:30:13 +01:00
anv: clear descriptorsets if AllocateDescriptorSets fails
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7285 Cc: mesa-stable Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18719>
This commit is contained in:
parent
79c2f9e7cb
commit
369c12e5be
1 changed files with 12 additions and 1 deletions
|
|
@ -1265,9 +1265,20 @@ VkResult anv_AllocateDescriptorSets(
|
||||||
pDescriptorSets[i] = anv_descriptor_set_to_handle(set);
|
pDescriptorSets[i] = anv_descriptor_set_to_handle(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS) {
|
||||||
anv_FreeDescriptorSets(_device, pAllocateInfo->descriptorPool,
|
anv_FreeDescriptorSets(_device, pAllocateInfo->descriptorPool,
|
||||||
i, pDescriptorSets);
|
i, pDescriptorSets);
|
||||||
|
/* The Vulkan 1.3.228 spec, section 14.2.3. Allocation of Descriptor Sets:
|
||||||
|
*
|
||||||
|
* "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."
|
||||||
|
*/
|
||||||
|
for (i = 0; i < pAllocateInfo->descriptorSetCount; i++)
|
||||||
|
pDescriptorSets[i] = VK_NULL_HANDLE;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue