From a80ffc9c7d14475058d8d72059ad645b323dd231 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 21 Nov 2023 17:04:45 +1000 Subject: [PATCH] GL/Context: Fix surfaceless context creation --- src/util/gl/context.cpp | 2 ++ src/util/vulkan_swap_chain.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/gl/context.cpp b/src/util/gl/context.cpp index 1a6cddd76..321455be0 100644 --- a/src/util/gl/context.cpp +++ b/src/util/gl/context.cpp @@ -133,6 +133,8 @@ std::unique_ptr Context::Create(const WindowInfo& wi, const Version if (wi.type == WindowInfo::Type::Wayland) context = ContextEGLWayland::Create(wi, versions_to_try, num_versions_to_try); #endif + if (wi.type == WindowInfo::Type::Surfaceless) + context = ContextEGL::Create(wi, versions_to_try, num_versions_to_try); #endif if (!context) diff --git a/src/util/vulkan_swap_chain.cpp b/src/util/vulkan_swap_chain.cpp index 2a825c10e..98df41e28 100644 --- a/src/util/vulkan_swap_chain.cpp +++ b/src/util/vulkan_swap_chain.cpp @@ -351,9 +351,11 @@ bool VulkanSwapChain::CreateSwapChain() image_count = std::min(image_count, surface_capabilities.maxImageCount); // Determine the dimensions of the swap chain. Values of -1 indicate the size we specify here - // determines window size? + // determines window size? Android sometimes lags updating currentExtent, so don't use it. VkExtent2D size = surface_capabilities.currentExtent; +#ifndef __ANDROID__ if (size.width == UINT32_MAX) +#endif { size.width = m_window_info.surface_width; size.height = m_window_info.surface_height;