From 82b70a023031144bba3472772cfdec42eb4954ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Tue, 15 Aug 2023 09:27:39 +0200 Subject: [PATCH] Cleanup. --- src/renderer_vk.cpp | 2 +- src/renderer_vk.h | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) 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 */ \