SDL: GPU: fix SDL_GetGPUSwapchainTextureFormat error return value

From 1e9ff723adbc5473c48a5965c2bc943806dc5d6f Mon Sep 17 00:00:00 2001
From: Andrei Alexeyev <[EMAIL REDACTED]>
Date: Tue, 10 Sep 2024 09:47:58 +0200
Subject: [PATCH] GPU: fix SDL_GetGPUSwapchainTextureFormat error return value

---
 src/gpu/d3d11/SDL_gpu_d3d11.c   | 2 +-
 src/gpu/metal/SDL_gpu_metal.m   | 2 +-
 src/gpu/vulkan/SDL_gpu_vulkan.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gpu/d3d11/SDL_gpu_d3d11.c b/src/gpu/d3d11/SDL_gpu_d3d11.c
index bd741c0422e11..e2df614302544 100644
--- a/src/gpu/d3d11/SDL_gpu_d3d11.c
+++ b/src/gpu/d3d11/SDL_gpu_d3d11.c
@@ -5348,7 +5348,7 @@ static SDL_GPUTextureFormat D3D11_GetSwapchainTextureFormat(
 
     if (windowData == NULL) {
         SDL_LogError(SDL_LOG_CATEGORY_GPU, "Cannot get swapchain format, window has not been claimed!");
-        return 0;
+        return SDL_GPU_TEXTUREFORMAT_INVALID;
     }
 
     return windowData->textureContainer.header.info.format;
diff --git a/src/gpu/metal/SDL_gpu_metal.m b/src/gpu/metal/SDL_gpu_metal.m
index c251267ea3675..aee3bdbb6edd8 100644
--- a/src/gpu/metal/SDL_gpu_metal.m
+++ b/src/gpu/metal/SDL_gpu_metal.m
@@ -3563,7 +3563,7 @@ static SDL_GPUTextureFormat METAL_GetSwapchainTextureFormat(
 
     if (windowData == NULL) {
         SDL_LogError(SDL_LOG_CATEGORY_GPU, "Cannot get swapchain format, window has not been claimed!");
-        return 0;
+        return SDL_GPU_TEXTUREFORMAT_INVALID;
     }
 
     return windowData->textureContainer.header.info.format;
diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c
index 174be59033507..3c31422d4a0b3 100644
--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/src/gpu/vulkan/SDL_gpu_vulkan.c
@@ -10132,12 +10132,12 @@ static SDL_GPUTextureFormat VULKAN_GetSwapchainTextureFormat(
 
     if (windowData == NULL) {
         SDL_LogError(SDL_LOG_CATEGORY_GPU, "Cannot get swapchain format, window has not been claimed!");
-        return 0;
+        return SDL_GPU_TEXTUREFORMAT_INVALID;
     }
 
     if (windowData->swapchainData == NULL) {
         SDL_LogError(SDL_LOG_CATEGORY_GPU, "Cannot get swapchain format, swapchain is currently invalid!");
-        return 0;
+        return SDL_GPU_TEXTUREFORMAT_INVALID;
     }
 
     return SwapchainCompositionToSDLFormat(