1
0
Fork 0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-06 20:58:37 +01:00

[dxgi] Report display metadata in IDXGIOutput6::GetDesc1

This commit is contained in:
Joshua Ashton 2022-11-17 17:22:22 +00:00 committed by Philip Rebohle
parent aa71e7e323
commit f0a0e1b964

View file

@ -215,23 +215,35 @@ namespace dxvk {
return E_FAIL; return E_FAIL;
} }
pDesc->AttachedToDesktop = 1; pDesc->AttachedToDesktop = 1;
pDesc->Rotation = DXGI_MODE_ROTATION_UNSPECIFIED; pDesc->Rotation = DXGI_MODE_ROTATION_UNSPECIFIED;
pDesc->Monitor = m_monitor; pDesc->Monitor = m_monitor;
pDesc->BitsPerColor = 8; // TODO: When in HDR, flip this to 10 to appease apps that the
pDesc->ColorSpace = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; // transition has occured.
// If we support more than HDR10 in future, then we may want
// We don't really have a way to get these // to visit that assumption.
for (uint32_t i = 0; i < 2; i++) { pDesc->BitsPerColor = 8;
pDesc->RedPrimary[i] = 0.0f; // This should only return DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
pDesc->GreenPrimary[i] = 0.0f; // (HDR) if the user has the HDR setting enabled in Windows.
pDesc->BluePrimary[i] = 0.0f; // Games can still punt into HDR mode by using CheckColorSpaceSupport
pDesc->WhitePoint[i] = 0.0f; // and SetColorSpace1.
} //
// TODO: When we have a swapchain using SetColorSpace1 to
pDesc->MinLuminance = 0.0f; // DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020, we should use our monitor
pDesc->MaxLuminance = 0.0f; // info to flip this over to that.
pDesc->MaxFullFrameLuminance = 0.0f; // As on Windows this would automatically engage HDR mode.
pDesc->ColorSpace = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709;
pDesc->RedPrimary[0] = m_metadata.redPrimary[0];
pDesc->RedPrimary[1] = m_metadata.redPrimary[1];
pDesc->GreenPrimary[0] = m_metadata.greenPrimary[0];
pDesc->GreenPrimary[1] = m_metadata.greenPrimary[1];
pDesc->BluePrimary[0] = m_metadata.bluePrimary[0];
pDesc->BluePrimary[1] = m_metadata.bluePrimary[1];
pDesc->WhitePoint[0] = m_metadata.whitePoint[0];
pDesc->WhitePoint[1] = m_metadata.whitePoint[1];
pDesc->MinLuminance = m_metadata.minLuminance;
pDesc->MaxLuminance = m_metadata.maxLuminance;
pDesc->MaxFullFrameLuminance = m_metadata.maxFullFrameLuminance;
return S_OK; return S_OK;
} }