Skip to content

Commit

Permalink
GPU: fix SDL_GetGPUSwapchainTextureFormat error return value
Browse files Browse the repository at this point in the history
  • Loading branch information
Akaricchi committed Sep 10, 2024
1 parent 640559e commit 6adeb62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gpu/d3d11/SDL_gpu_d3d11.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/gpu/metal/SDL_gpu_metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/gpu/vulkan/SDL_gpu_vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6adeb62

Please sign in to comment.