mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
c/util: Improve error paths in swapchain creation
This commit is contained in:
parent
c6a4f62e6c
commit
add64c1531
|
@ -397,12 +397,7 @@ do_post_create_vulkan_setup(struct vk_bundle *vk,
|
||||||
|
|
||||||
// Now lets create the command buffer.
|
// Now lets create the command buffer.
|
||||||
ret = vk_cmd_pool_create_and_begin_cmd_buffer_locked(vk, pool, 0, &cmd_buffer);
|
ret = vk_cmd_pool_create_and_begin_cmd_buffer_locked(vk, pool, 0, &cmd_buffer);
|
||||||
if (ret != VK_SUCCESS) {
|
VK_CHK_WITH_GOTO(ret, "vk_cmd_pool_create_and_begin_cmd_buffer_locked", error_unlock);
|
||||||
VK_ERROR(vk, "Failed to barrier images");
|
|
||||||
vk_cmd_pool_unlock(pool);
|
|
||||||
cleanup_post_create_vulkan_setup(vk, sc);
|
|
||||||
return XRT_ERROR_VULKAN;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Name it for debugging.
|
// Name it for debugging.
|
||||||
VK_NAME_COMMAND_BUFFER(vk, cmd_buffer, "comp_swapchain command buffer");
|
VK_NAME_COMMAND_BUFFER(vk, cmd_buffer, "comp_swapchain command buffer");
|
||||||
|
@ -436,11 +431,7 @@ do_post_create_vulkan_setup(struct vk_bundle *vk,
|
||||||
vk_cmd_pool_unlock(pool);
|
vk_cmd_pool_unlock(pool);
|
||||||
|
|
||||||
// Check results from submit.
|
// Check results from submit.
|
||||||
if (ret != VK_SUCCESS) {
|
VK_CHK_WITH_GOTO(ret, "vk_cmd_pool_end_submit_wait_and_free_cmd_buffer_locked", error);
|
||||||
VK_ERROR(vk, "Failed to barrier images");
|
|
||||||
cleanup_post_create_vulkan_setup(vk, sc);
|
|
||||||
return XRT_ERROR_VULKAN;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Init all of the threading objects.
|
// Init all of the threading objects.
|
||||||
for (uint32_t i = 0; i < image_count; i++) {
|
for (uint32_t i = 0; i < image_count; i++) {
|
||||||
|
@ -462,8 +453,14 @@ do_post_create_vulkan_setup(struct vk_bundle *vk,
|
||||||
sc->images[i].use_count = 0;
|
sc->images[i].use_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (xret != XRT_SUCCESS) {
|
||||||
|
cleanup_post_create_vulkan_setup(vk, sc);
|
||||||
|
}
|
||||||
|
|
||||||
return xret;
|
return xret;
|
||||||
|
|
||||||
|
error_unlock:
|
||||||
|
vk_cmd_pool_unlock(pool);
|
||||||
error:
|
error:
|
||||||
cleanup_post_create_vulkan_setup(vk, sc);
|
cleanup_post_create_vulkan_setup(vk, sc);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue