(Vulkan WSI) Add Mir bits (we don't have Mir context driver yet

but whatever, add them all)
This commit is contained in:
twinaphex 2016-02-19 13:06:38 +01:00
parent 50efe142b9
commit 7ec1a6836c

View File

@ -77,6 +77,9 @@ typedef struct gfx_ctx_vulkan_data
#endif
#ifdef HAVE_WAYLAND
PFN_vkCreateWaylandSurfaceKHR fpCreateWaylandSurfaceKHR;
#endif
#ifdef HAVE_MIR
FN_vkCreateMirSurfaceKHR fpCreateMirSurfaceKHR;
#endif
PFN_vkDestroySurfaceKHR fpDestroySurfaceKHR;
@ -816,6 +819,12 @@ static bool vulkan_init_context(gfx_ctx_vulkan_data_t *vk,
#ifdef HAVE_XCB
VK_GET_INSTANCE_PROC_ADDR(vk,
vk->context.instance, CreateXcbSurfaceKHR);
#endif
break;
case VULKAN_WSI_MIR:
#ifdef HAVE_MIR
VK_GET_INSTANCE_PROC_ADDR(vk,
vk->context.instance, CreateMirSurfaceKHR);
#endif
break;
case VULKAN_WSI_NONE:
@ -1216,6 +1225,24 @@ static bool vulkan_surface_create(gfx_ctx_vulkan_data_t *vk,
!= VK_SUCCESS)
return false;
}
#endif
break;
case VULKAN_WSI_MIR:
#ifdef HAVE_MIR
{
VkMirSurfaceCreateInfoKHR surf_info;
memset(&surf_info, 0, sizeof(VkMirSurfaceCreateInfoKHR));
surf_info.sType = VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR;
surf_info.connection = display;
surf_info.mirSurface = surface;
if (vk->fpCreateMirSurfaceKHR(vk->context.instance,
&surf_info, NULL, &vk->vk_surface)
!= VK_SUCCESS)
return false;
}
#endif
break;
case VULKAN_WSI_NONE: