diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index d04a793ce..d0639a7cc 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -19,7 +19,7 @@ #if WL_EGL_PLATFORM # include -#endif +#endif // WL_EGL_PLATFORM namespace bgfx { namespace vk { diff --git a/src/renderer_vk.h b/src/renderer_vk.h index 9d07d8e4d..a143147b8 100644 --- a/src/renderer_vk.h +++ b/src/renderer_vk.h @@ -6,19 +6,23 @@ #ifndef BGFX_RENDERER_VK_H_HEADER_GUARD #define BGFX_RENDERER_VK_H_HEADER_GUARD +#ifndef WL_EGL_PLATFORM +# define WL_EGL_PLATFORM 0 +#endif // WL_EGL_PLATFORM + #if BX_PLATFORM_ANDROID # define VK_USE_PLATFORM_ANDROID_KHR # define KHR_SURFACE_EXTENSION_NAME VK_KHR_ANDROID_SURFACE_EXTENSION_NAME # define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_ANDROID #elif BX_PLATFORM_LINUX -#if WL_EGL_PLATFORM -# define VK_USE_PLATFORM_WAYLAND_KHR -# define KHR_SURFACE_EXTENSION_NAME VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME -#else -# define VK_USE_PLATFORM_XLIB_KHR -# define VK_USE_PLATFORM_XCB_KHR -# define KHR_SURFACE_EXTENSION_NAME VK_KHR_XCB_SURFACE_EXTENSION_NAME -#endif // WL_EGL_PLATFORM +# if WL_EGL_PLATFORM +# define VK_USE_PLATFORM_WAYLAND_KHR +# define KHR_SURFACE_EXTENSION_NAME VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME +# else +# define VK_USE_PLATFORM_XLIB_KHR +# define VK_USE_PLATFORM_XCB_KHR +# define KHR_SURFACE_EXTENSION_NAME VK_KHR_XCB_SURFACE_EXTENSION_NAME +# endif // WL_EGL_PLATFORM # define VK_IMPORT_INSTANCE_PLATFORM VK_IMPORT_INSTANCE_LINUX #elif BX_PLATFORM_WINDOWS # define VK_USE_PLATFORM_WIN32_KHR @@ -72,7 +76,6 @@ VK_IMPORT_INSTANCE_FUNC(true, vkCreateWaylandSurfaceKHR); \ VK_IMPORT_INSTANCE_FUNC(true, vkGetPhysicalDeviceWaylandPresentationSupportKHR); \ - #else #define VK_IMPORT_INSTANCE_LINUX \ /* VK_KHR_xlib_surface */ \