radv: Properly handle modifier import failure.

The layout code can fail now in the non-delayed case with modifiers.

Fixes: 7f7da82dbb ("radv: Add image layout with drm format modifiers.")
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9012>
This commit is contained in:
Bas Nieuwenhuizen 2021-02-12 15:08:32 +01:00 committed by Marge Bot
parent 8a61f31160
commit a740318e42
1 changed files with 5 additions and 2 deletions

View File

@ -1643,8 +1643,11 @@ radv_image_create(VkDevice _device,
return VK_SUCCESS;
}
ASSERTED VkResult result = radv_image_create_layout(device, *create_info, explicit_mod, image);
assert(result == VK_SUCCESS);
VkResult result = radv_image_create_layout(device, *create_info, explicit_mod, image);
if (result != VK_SUCCESS) {
radv_destroy_image(device, alloc, image);
return result;
}
if (image->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) {
image->alignment = MAX2(image->alignment, 4096);