mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Merge pull request #7122 from orbea/vulkan
Fix segfaults when starting vulkan without a working vulkan driver.
This commit is contained in:
commit
ea87bb5a1d
@ -1827,7 +1827,10 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
|
||||
VK_DEBUG_REPORT_WARNING_BIT_EXT |
|
||||
VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT;
|
||||
info.pfnCallback = vulkan_debug_cb;
|
||||
vkCreateDebugReportCallbackEXT(vk->context.instance, &info, NULL, &vk->context.debug_callback);
|
||||
|
||||
if (vk->context.instance)
|
||||
vkCreateDebugReportCallbackEXT(vk->context.instance, &info, NULL,
|
||||
&vk->context.debug_callback);
|
||||
}
|
||||
RARCH_LOG("[Vulkan]: Enabling Vulkan debug layers.\n");
|
||||
#endif
|
||||
|
@ -744,6 +744,9 @@ static bool vulkan_init_default_filter_chain(vk_t *vk)
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
|
||||
if (!vk->context)
|
||||
return false;
|
||||
|
||||
info.device = vk->context->device;
|
||||
info.gpu = vk->context->gpu;
|
||||
info.memory_properties = &vk->context->memory_properties;
|
||||
@ -832,7 +835,7 @@ static bool vulkan_init_filter_chain(vk_t *vk)
|
||||
|
||||
static void vulkan_init_resources(vk_t *vk)
|
||||
{
|
||||
if (!vk)
|
||||
if (!vk->context)
|
||||
return;
|
||||
|
||||
vk->num_swapchain_images = vk->context->num_swapchain_images;
|
||||
@ -855,6 +858,9 @@ static void vulkan_init_static_resources(vk_t *vk)
|
||||
VkPipelineCacheCreateInfo cache = {
|
||||
VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO };
|
||||
|
||||
if (!vk->context)
|
||||
return;
|
||||
|
||||
vkCreatePipelineCache(vk->context->device,
|
||||
&cache, NULL, &vk->pipelines.cache);
|
||||
|
||||
@ -2357,6 +2363,9 @@ static void vulkan_viewport_info(void *data, struct video_viewport *vp)
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
if (!vk)
|
||||
return;
|
||||
|
||||
/* Make sure we get the correct viewport. */
|
||||
vulkan_set_viewport(vk, width, height, false, true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user