Skip to content

Commit

Permalink
Fix typo of RGB_STUDIO vs RGB_FULL in DXGI interop.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Mar 25, 2024
1 parent 7b07e56 commit 284f153
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vulkan/wsi_dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static DXGI_COLOR_SPACE_TYPE convert_vk_color_space(VkColorSpaceKHR colspace)
case VK_COLOR_SPACE_HDR10_ST2084_EXT:
return DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020;
case VK_COLOR_SPACE_SRGB_NONLINEAR_KHR:
return DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709;
return DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709;
default:
return DXGI_COLOR_SPACE_RESERVED;
}
Expand Down Expand Up @@ -371,15 +371,15 @@ bool DXGIInteropSwapchain::init_swapchain(HWND hwnd_, VkSurfaceFormatKHR format,
((space_support & DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT) == 0))
{
// Fallback to SDR if HDR doesn't pass check.
if (FAILED(swapchain->CheckColorSpaceSupport(DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709, &space_support)) ||
if (FAILED(swapchain->CheckColorSpaceSupport(DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709, &space_support)) ||
((space_support & DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT) == 0))
{
return false;
}

LOGW("HDR10 not supported by DXGI swapchain, falling back to SDR.\n");
surface_format.colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
color_space = DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709;
color_space = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709;
}

if (FAILED(swapchain->SetColorSpace1(color_space)))
Expand Down

0 comments on commit 284f153

Please sign in to comment.