Skip to content

Commit 75d7f08

Browse files
committed
vulkan: log codes for some errors to aid debugging
1 parent e661dde commit 75d7f08

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

gfx/common/vulkan_common.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,11 +2381,15 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
23812381
}
23822382
#endif
23832383

2384-
if (vkCreateSwapchainKHR(vk->context.device,
2385-
&info, NULL, &vk->swapchain) != VK_SUCCESS)
23862384
{
2387-
RARCH_ERR("[Vulkan] Failed to create swapchain.\n");
2388-
return false;
2385+
VkResult res = vkCreateSwapchainKHR(vk->context.device,
2386+
&info, NULL, &vk->swapchain);
2387+
if (res != VK_SUCCESS)
2388+
{
2389+
RARCH_ERR("[Vulkan] Failed to create swapchain (err = %d).\n",
2390+
(int)res);
2391+
return false;
2392+
}
23892393
}
23902394

23912395
vk->context.swapchain_width = swapchain_size.width;
@@ -2752,7 +2756,8 @@ void vulkan_present(gfx_ctx_vulkan_data_t *vk, unsigned index)
27522756

27532757
if (err != VK_SUCCESS || result != VK_SUCCESS)
27542758
{
2755-
RARCH_LOG("[Vulkan] QueuePresent failed, destroying swapchain.\n");
2759+
RARCH_LOG("[Vulkan] QueuePresent failed (err = %d, result = %d), destroying swapchain.\n",
2760+
(int)err, (int)result);
27562761
vulkan_destroy_swapchain(vk);
27572762
}
27582763

0 commit comments

Comments
 (0)