mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-18 09:18:14 +00:00
GPU: fix SDL_GetGPUSwapchainTextureFormat error return value
This commit is contained in:

committed by
Sam Lantinga

parent
640559eba6
commit
1e9ff723ad
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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(
|
||||
|
Reference in New Issue
Block a user