From dd5c60476889ada3b6ba9f017e6fe3cd900d9a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Seppo=20R=C3=A4is=C3=A4nen?= Date: Tue, 24 Feb 2026 21:57:54 +0200 Subject: [PATCH] Backends: SDLGPU3: remove unnecessary call to SDL_WaitForGPUIdle when releasing vertex/index buffers. (#9262) --- backends/imgui_impl_sdlgpu3.cpp | 4 ++-- docs/CHANGELOG.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backends/imgui_impl_sdlgpu3.cpp b/backends/imgui_impl_sdlgpu3.cpp index 975fcefb9..783923052 100644 --- a/backends/imgui_impl_sdlgpu3.cpp +++ b/backends/imgui_impl_sdlgpu3.cpp @@ -22,6 +22,7 @@ // Calling the function is MANDATORY, otherwise the ImGui will not upload neither the vertex nor the index buffer for the GPU. See imgui_impl_sdlgpu3.cpp for more info. // CHANGELOG +// 2026-02-25: Removed unnecessary call to SDL_WaitForGPUIdle when releasing vertex/index buffers. (#9262) // 2025-11-26: macOS version can use MSL shaders in order to support macOS 10.14+ (vs Metallib shaders requiring macOS 14+). Requires calling SDL_CreateGPUDevice() with SDL_GPU_SHADERFORMAT_MSL. // 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown. // 2025-08-20: Added ImGui_ImplSDLGPU3_InitInfo::SwapchainComposition and ImGui_ImplSDLGPU3_InitInfo::PresentMode to configure how secondary viewports are created. @@ -131,8 +132,7 @@ static void CreateOrResizeBuffers(SDL_GPUBuffer** buffer, SDL_GPUTransferBuffer* ImGui_ImplSDLGPU3_Data* bd = ImGui_ImplSDLGPU3_GetBackendData(); ImGui_ImplSDLGPU3_InitInfo* v = &bd->InitInfo; - // FIXME-OPT: Not optimal, but this is fairly rarely called. - SDL_WaitForGPUIdle(v->Device); + // There is no need for calling SDL_WaitForGPUIdle here, as SDL3 will handle deferred buffer deletion automatically. SDL_ReleaseGPUBuffer(v->Device, *buffer); SDL_ReleaseGPUTransferBuffer(v->Device, *transferbuffer); diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index a7e880ab8..1f030e482 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -66,6 +66,8 @@ Other Changes: - Added `UserIndex` helper storage. This is solely a convenience for cases where you may want to carry an index around. - Backends: + - SDLGPU3: removed unnecessary call to SDL_WaitForGPUIdle when releasing + vertex/index buffers. (#9262) [@jaenis] - WebGPU: fixed version check for Emscripten 5.0.0+. - Examples: - Emscripten: added `tabindex=-1` to canvas in our shell_minimal.htm. Without it,