Add vulkan path in registry_handle_global

This commit is contained in:
twinaphex 2016-02-18 05:31:24 +01:00
parent 620fbe8976
commit bd672b8b72

View File

@ -184,7 +184,25 @@ static void registry_handle_global(void *data, struct wl_registry *reg,
(void)version;
if (string_is_equal(interface, "wl_compositor"))
wl->compositor = (struct wl_compositor*)wl_registry_bind(reg, id, &wl_compositor_interface, 1);
{
unsigned num = 1;
switch (wl_api)
{
case GFX_CTX_OPENGL_API:
case GFX_CTX_OPENGL_ES_API:
case GFX_CTX_OPENVG_API:
break;
case GFX_CTX_VULKAN_API:
num = 3;
break;
case GFX_CTX_NONE:
default:
break;
}
wl->compositor = (struct wl_compositor*)wl_registry_bind(reg,
id, &wl_compositor_interface, num);
}
else if (string_is_equal(interface, "wl_shell"))
wl->shell = (struct wl_shell*)wl_registry_bind(reg, id, &wl_shell_interface, 1);
}
@ -375,13 +393,14 @@ static bool gfx_ctx_wl_set_resize(void *data, unsigned width, unsigned height)
#ifdef HAVE_VULKAN_SUPPORT
wl->width = width;
wl->height = height;
if (!vulkan_create_swapchain(wl))
if (vulkan_create_swapchain(wl))
wl->context.invalid_swapchain = true;
else
{
RARCH_ERR("[Wayland/Vulkan]: Failed to update swapchain.\n");
return false;
}
else
wl->context.invalid_swapchain = true;
wl->need_new_swapchain = false;
#endif
@ -596,6 +615,7 @@ static void *gfx_ctx_wl_init(void *video_driver)
break;
case GFX_CTX_VULKAN_API:
#ifdef HAVE_VULKAN_SUPPORT
{
app.pApplicationName = "RetroArch";
app.applicationVersion = 0;
app.pEngineName = "RetroArch";
@ -685,6 +705,7 @@ static void *gfx_ctx_wl_init(void *video_driver)
wl->context.queue_lock = slock_new();
if (!wl->context.queue_lock)
goto error;
}
#endif
break;
case GFX_CTX_NONE: