From b9a6e07448fd1d186cdc5c616161454253a3da7c Mon Sep 17 00:00:00 2001 From: David Gonzalez Martin Date: Fri, 20 Dec 2024 05:48:54 -0600 Subject: [PATCH] Fix small Vulkan X11 extensions issue --- CMakeLists.txt | 2 +- bootstrap/std/render.c | 40 +++------------------------------------- 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc8dc7b..ec32d08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,7 +211,7 @@ if (NOT BB_IS_CI) set(VOLK_STATIC_DEFINES VK_USE_PLATFORM_WIN32_KHR) target_compile_definitions(${COMPILER_NAME} PRIVATE GLFW_EXPOSE_NATIVE_WIN32) elseif(CMAKE_SYSTEM_NAME STREQUAL Linux) - set(VOLK_STATIC_DEFINES VK_USE_PLATFORM_XLIB_KHR) + set(VOLK_STATIC_DEFINES VK_USE_PLATFORM_XCB_KHR) target_compile_definitions(${COMPILER_NAME} PRIVATE GLFW_EXPOSE_NATIVE_X11) elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin) set(VOLK_STATIC_DEFINES VK_USE_PLATFORM_METAL_EXT) diff --git a/bootstrap/std/render.c b/bootstrap/std/render.c index 76096b7..8a294f2 100644 --- a/bootstrap/std/render.c +++ b/bootstrap/std/render.c @@ -919,6 +919,9 @@ Renderer* renderer_initialize(Arena* arena) #endif #ifdef VK_USE_PLATFORM_XLIB_KHR VK_KHR_XLIB_SURFACE_EXTENSION_NAME, +#endif +#ifdef VK_USE_PLATFORM_XCB_KHR + VK_KHR_XCB_SURFACE_EXTENSION_NAME, #endif #ifdef VK_USE_PLATFORM_WAYLAND_KHR VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, @@ -1654,43 +1657,6 @@ RenderWindow* renderer_window_initialize(Renderer* renderer, OSWindow window) { RenderWindow* result = &renderer_window_memory; vkok(glfwCreateWindowSurface(renderer->instance, window, renderer->allocator, &result->surface)); -// { -// #ifdef VK_USE_PLATFORM_WIN32_KHR -// VkWin32SurfaceCreateInfoKHR create_info = { -// .sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR, -// .pNext = 0, -// .flags = 0, -// .hinstance = os_windows_get_module_handle(), -// .hwnd = win32_window_get(window), -// }; -// vkok(vkCreateWin32SurfaceKHR(renderer->instance, &create_info, renderer->allocator, &result->surface)); -// #endif -// -// #ifdef VK_USE_PLATFORM_XLIB_KHR -// VkXlibSurfaceCreateInfoKHR create_info = { -// .sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR, -// .pNext = 0, -// .flags = 0, -// .dpy = x11_display_get(), -// .window = x11_window_get(window), -// }; -// vkok(vkCreateXlibSurfaceKHR(renderer->instance, &create_info, renderer->allocator, &result->surface)); -// #endif -// -// #ifdef VK_USE_PLATFORM_WAYLAND_KHR -// VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, -// #endif -// -// #ifdef VK_USE_PLATFORM_METAL_EXT -// VkMetalSurfaceCreateInfoEXT create_info = { -// .sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT, -// .pNext = 0, -// .flags = 0, -// }; -// -// vkok(vkCreateMetalSurfaceEXT(renderer->instance, &create_info, renderer->allocator, &result->surface)); -// #endif -// } swapchain_recreate(renderer, result);