Skip to content

Commit 2473e83

Browse files
committed
vk: Fix swapchain format selection
Some platforms don't support R8G8B8_UNORM, making the selection pick the first format of the driver provided list (which could be sRGB). Look for either R8G8B8_UNORM or B8G8R8A8_UNORM which should cover more platforms.
1 parent 81b21f9 commit 2473e83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

RSDKv5/RSDK/Graphics/Vulkan/VulkanRenderDevice.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,8 @@ bool RenderDevice::InitGraphicsAPI()
566566
VkExtent2D pickedExtent = currentSwapDetails.capabilities.currentExtent;
567567

568568
for (const auto &availableFormat : currentSwapDetails.formats) {
569-
if (availableFormat.format == VK_FORMAT_R8G8B8_UNORM && availableFormat.colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR) {
569+
if ((availableFormat.format == VK_FORMAT_R8G8B8_UNORM || availableFormat.format == VK_FORMAT_B8G8R8A8_UNORM)
570+
&& availableFormat.colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR) {
570571
pickedFormat = availableFormat;
571572
break;
572573
}

0 commit comments

Comments
 (0)