diff --git a/application/platforms/application_sdl3.cpp b/application/platforms/application_sdl3.cpp index ae22beb4..ef69d49d 100644 --- a/application/platforms/application_sdl3.cpp +++ b/application/platforms/application_sdl3.cpp @@ -389,25 +389,12 @@ struct WSIPlatformSDL : GraniteWSIPlatform void notify_resize(unsigned width_, unsigned height_) { - uint64_t current_resize_timestamp = swapchain_dimension_update_timestamp; - + LOGI("Resize: %u x %u\n", width_, height_); push_task_to_async_thread([=]() { resize = true; width = width_; height = height_; }); - - if (options.threaded) - { - // Give the async thread a chance to catch up with main thread so it can create a new swapchain before - // we invalidate the swapchain again. - // There is a gap when querying swapchain dimensions and when we create the swapchain. - // On most platforms, the query must match the swapchain, - // so if we keep processing OS events, things will get out of sync. - // Need to observe that the async thread updates the swapchain dimensions at least once. - while (current_resize_timestamp == swapchain_dimension_update_timestamp && async_loop_alive) - process_events_main_thread_blocking(); - } } void notify_current_swapchain_dimensions(unsigned width_, unsigned height_) override diff --git a/vulkan/wsi.cpp b/vulkan/wsi.cpp index 81cbec1e..a66517a7 100644 --- a/vulkan/wsi.cpp +++ b/vulkan/wsi.cpp @@ -548,6 +548,7 @@ bool WSI::begin_frame() LOGI("AcquireNextImageKHR is suboptimal, will recreate.\n"); #endif swapchain_is_suboptimal = true; + LOGW("Swapchain suboptimal.\n"); } if (result >= 0) @@ -576,6 +577,7 @@ bool WSI::begin_frame() } else if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT) { + LOGW("Swapchain out of date.\n"); VK_ASSERT(swapchain_width != 0); VK_ASSERT(swapchain_height != 0); diff --git a/vulkan/wsi.hpp b/vulkan/wsi.hpp index 8eb18c63..4ebb4179 100644 --- a/vulkan/wsi.hpp +++ b/vulkan/wsi.hpp @@ -68,7 +68,6 @@ class WSIPlatform resize = false; current_swapchain_width = width; current_swapchain_height = height; - swapchain_dimension_update_timestamp++; } virtual uint32_t get_surface_width() = 0; @@ -132,7 +131,6 @@ class WSIPlatform protected: unsigned current_swapchain_width = 0; unsigned current_swapchain_height = 0; - uint64_t swapchain_dimension_update_timestamp = 0; bool resize = false; private: