Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/doitsujin/dxvk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ashton <joshua@froggi.es>2022-11-17 20:22:22 +0300
committerJoshua Ashton <joshua@froggi.es>2022-11-21 19:25:54 +0300
commit45ed630d961b4207c262c5bc85aa1abff12f9e00 (patch)
tree072d45cfc1d4fd1ac7d5cea24e2fb1e71459cbeb
parentd3168b04ead361095f58daf9a816286b1a7ff6b3 (diff)
[dxgi] Report display metadata in IDXGIOutput6::GetDesc1hdr-colorimetry
-rw-r--r--src/dxgi/dxgi_output.cpp46
1 files changed, 29 insertions, 17 deletions
diff --git a/src/dxgi/dxgi_output.cpp b/src/dxgi/dxgi_output.cpp
index e319b30a..21db7137 100644
--- a/src/dxgi/dxgi_output.cpp
+++ b/src/dxgi/dxgi_output.cpp
@@ -215,23 +215,35 @@ namespace dxvk {
return E_FAIL;
}
- pDesc->AttachedToDesktop = 1;
- pDesc->Rotation = DXGI_MODE_ROTATION_UNSPECIFIED;
- pDesc->Monitor = m_monitor;
- pDesc->BitsPerColor = 8;
- pDesc->ColorSpace = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709;
-
- // We don't really have a way to get these
- for (uint32_t i = 0; i < 2; i++) {
- pDesc->RedPrimary[i] = 0.0f;
- pDesc->GreenPrimary[i] = 0.0f;
- pDesc->BluePrimary[i] = 0.0f;
- pDesc->WhitePoint[i] = 0.0f;
- }
-
- pDesc->MinLuminance = 0.0f;
- pDesc->MaxLuminance = 0.0f;
- pDesc->MaxFullFrameLuminance = 0.0f;
+ pDesc->AttachedToDesktop = 1;
+ pDesc->Rotation = DXGI_MODE_ROTATION_UNSPECIFIED;
+ pDesc->Monitor = m_monitor;
+ // TODO: When in HDR, flip this to 10 to appease apps that the
+ // transition has occured.
+ // If we support more than HDR10 in future, then we may want
+ // to visit that assumption.
+ pDesc->BitsPerColor = 8;
+ // This should only return DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020
+ // (HDR) if the user has the HDR setting enabled in Windows.
+ // Games can still punt into HDR mode by using CheckColorSpaceSupport
+ // and SetColorSpace1.
+ //
+ // TODO: When we have a swapchain using SetColorSpace1 to
+ // DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020, we should use our monitor
+ // info to flip this over to that.
+ // 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;
}