Skip to content

Commit

Permalink
Clamp to swapchain support extents on non-Apple
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcosmonaut committed Oct 9, 2024
1 parent 0e288b5 commit bb63fc9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gpu/vulkan/SDL_gpu_vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -4542,8 +4542,13 @@ static Uint32 VULKAN_INTERNAL_CreateSwapchain(
windowData->width = swapchainSupportDetails.capabilities.currentExtent.width;
windowData->height = swapchainSupportDetails.capabilities.currentExtent.height;
#else
windowData->width = windowData->swapchainCreateWidth;
windowData->height = windowData->swapchainCreateHeight;
windowData->width = SDL_clamp(
windowData->swapchainCreateWidth,
swapchainSupportDetails.capabilities.minImageExtent.width,
swapchainSupportDetails.capabilities.maxImageExtent.width);
windowData->height = SDL_clamp(windowData->swapchainCreateHeight,
swapchainSupportDetails.capabilities.minImageExtent.height,
swapchainSupportDetails.capabilities.maxImageExtent.height);
#endif

if (swapchainSupportDetails.capabilities.maxImageCount > 0 &&
Expand Down

0 comments on commit bb63fc9

Please sign in to comment.