mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-27 17:54:18 +00:00
gpu: Use the window event watcher list for Vulkan and D3D12
Events won't be delivered to the regular event watcher list callbacks if a client event filter discards events. Use the special window event watcher list to watch for resizes in the GPU renderers, as events are delivered to this list before a client can potentially discard them.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <SDL3/SDL_vulkan.h>
|
||||
|
||||
#include "../SDL_sysgpu.h"
|
||||
#include "../../events/SDL_windowevents_c.h"
|
||||
|
||||
// Global Vulkan Loader Entry Points
|
||||
|
||||
@@ -9815,7 +9816,7 @@ static bool VULKAN_ClaimWindow(
|
||||
renderer->claimedWindowCount += 1;
|
||||
SDL_UnlockMutex(renderer->windowLock);
|
||||
|
||||
SDL_AddEventWatch(VULKAN_INTERNAL_OnWindowResize, window);
|
||||
SDL_AddWindowEventWatch(SDL_WINDOW_EVENT_WATCH_NORMAL, VULKAN_INTERNAL_OnWindowResize, window);
|
||||
|
||||
return true;
|
||||
} else if (createSwapchainResult == VULKAN_INTERNAL_TRY_AGAIN) {
|
||||
@@ -9880,7 +9881,7 @@ static void VULKAN_ReleaseWindow(
|
||||
SDL_free(windowData);
|
||||
|
||||
SDL_ClearProperty(SDL_GetWindowProperties(window), WINDOW_PROPERTY_DATA);
|
||||
SDL_RemoveEventWatch(VULKAN_INTERNAL_OnWindowResize, window);
|
||||
SDL_RemoveWindowEventWatch(SDL_WINDOW_EVENT_WATCH_NORMAL, VULKAN_INTERNAL_OnWindowResize, window);
|
||||
}
|
||||
|
||||
static Uint32 VULKAN_INTERNAL_RecreateSwapchain(
|
||||
|
||||
Reference in New Issue
Block a user