Browse Source

SDL_gpu_vulkan.c: Silence -Wuninitialized warning from old gcc versions:

SDL_gpu_vulkan.c: In function 'VULKAN_GetXRSwapchainFormats':
SDL_gpu_vulkan.c:12927: warning: 'sdlFormat' may be used uninitialized in this function
Ozkan Sezer 1 month ago
parent
commit
427941012e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/gpu/vulkan/SDL_gpu_vulkan.c

+ 1 - 1
src/gpu/vulkan/SDL_gpu_vulkan.c

@@ -12924,7 +12924,7 @@ static SDL_GPUTextureFormat* VULKAN_GetXRSwapchainFormats(
     // FIXME: For now we're just searching for the optimal format, not all supported formats.
     // FIXME: For now we're just searching for the optimal format, not all supported formats.
     // FIXME: Expand this search for all SDL_GPU formats!
     // FIXME: Expand this search for all SDL_GPU formats!
 
 
-    SDL_GPUTextureFormat sdlFormat;
+    SDL_GPUTextureFormat sdlFormat = SDL_GPU_TEXTUREFORMAT_INVALID;
     int64_t vkFormat = VK_FORMAT_UNDEFINED;
     int64_t vkFormat = VK_FORMAT_UNDEFINED;
     // 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
     // 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 (!VULKAN_INTERNAL_FindXRSrgbSwapchain(supported_formats, num_supported_formats, &sdlFormat, &vkFormat)) {
     if (!VULKAN_INTERNAL_FindXRSrgbSwapchain(supported_formats, num_supported_formats, &sdlFormat, &vkFormat)) {