From 59e3ad0079a4d80fc339d48ca62c37b640bf0f01 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 4 Feb 2026 07:47:02 +0300 Subject: [PATCH] SDL_gpu_d3d12.c: Silence -Wuninitialized warning from old gcc versions: SDL_gpu_d3d12.c: In function 'D3D12_GetXRSwapchainFormats': SDL_gpu_d3d12.c:9107:26: warning: 'sdlFormat' may be used uninitialized in this function --- src/gpu/d3d12/SDL_gpu_d3d12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c index a16b785b32..a2190f7ccd 100644 --- a/src/gpu/d3d12/SDL_gpu_d3d12.c +++ b/src/gpu/d3d12/SDL_gpu_d3d12.c @@ -9104,7 +9104,7 @@ static SDL_GPUTextureFormat* D3D12_GetXRSwapchainFormats( // FIXME: For now we're just searching for the optimal format, not all supported formats. // FIXME: Expand this search for all SDL_GPU formats! - SDL_GPUTextureFormat sdlFormat; + SDL_GPUTextureFormat sdlFormat = SDL_GPU_TEXTUREFORMAT_INVALID; DXGI_FORMAT dxgiFormat = DXGI_FORMAT_UNKNOWN; // The OpenXR spec recommends applications not submit linear data, so let's try to explicitly find an sRGB swapchain before we search the whole list if (!D3D12_INTERNAL_FindXRSrgbSwapchain(supported_formats, num_supported_formats, &sdlFormat, &dxgiFormat)) {