summaryrefslogtreecommitdiffstats
path: root/tests/manual/rhi/hdr/hdr.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2023-08-15 08:22:10 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2023-08-15 15:10:35 +0200
commit55c79dcc25ad1d34361797d265b575d8ea725965 (patch)
tree886b9032eed5100ab009e38f61cae6e7293ca628 /tests/manual/rhi/hdr/hdr.cpp
parentea75e34d6968bb59624874411e793c95b26d0dbe (diff)
rhi: add a way to test Display P3 with the manual test
Extended linear Display P3 + FP16 is likely the thing to use on platforms such as VisionOS and iOS (and optionally on macOS) and perhaps iOS). Enable testing this on macOS with the hdr manual test. Change-Id: I67f0bdbadae8c7ebccae7de008f12fd8d9135529 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'tests/manual/rhi/hdr/hdr.cpp')
-rw-r--r--tests/manual/rhi/hdr/hdr.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/manual/rhi/hdr/hdr.cpp b/tests/manual/rhi/hdr/hdr.cpp
index ab51b7a8e8..52f03bcb10 100644
--- a/tests/manual/rhi/hdr/hdr.cpp
+++ b/tests/manual/rhi/hdr/hdr.cpp
@@ -188,6 +188,9 @@ void preInit()
if (args.contains("scrgb")) {
d.usingHDRWindow = true;
swapchainFormat = QRhiSwapChain::HDRExtendedSrgbLinear;
+ } else if (args.contains("p3")) {
+ d.usingHDRWindow = true;
+ swapchainFormat = QRhiSwapChain::HDRExtendedDisplayP3Linear;
} else if (args.contains("sdr")) {
d.usingHDRWindow = false;
swapchainFormat = QRhiSwapChain::SDR;
@@ -365,9 +368,15 @@ void Window::customGui()
ImGui::Begin("HDR test");
if (d.usingHDRWindow) {
- ImGui::Text("The window is now scRGB (extended *linear* sRGB) + FP16 color buffer,\n"
- "the ImGui UI and the green background are considered SDR content,\n"
- "the cube is using a HDR texture.");
+ if (swapchainFormat == QRhiSwapChain::HDRExtendedDisplayP3Linear) {
+ ImGui::Text("The window is now Extended Linear Display P3 + FP16 color buffer,\n"
+ "the ImGui UI and the green background are considered SDR content,\n"
+ "the cube is using a HDR texture.");
+ } else {
+ ImGui::Text("The window is now scRGB (Extended Linear sRGB) + FP16 color buffer,\n"
+ "the ImGui UI and the green background are considered SDR content,\n"
+ "the cube is using a HDR texture.");
+ }
ImGui::Checkbox("Adjust SDR content", &d.adjustSDR);
addTip("Multiplies fragment colors for non-HDR content with sdr_white_level / 80. "
"Not relevant with macOS (due to EDR being display-referred).");