summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhi.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2023-08-01 14:40:41 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2023-08-03 12:17:25 +0200
commit547b9da7ad818446a2eeb80985959c9dee7089fb (patch)
tree1ce4481222e84334c4dbf59276b867cff91d2fbe /src/gui/rhi/qrhi.h
parent78bc1a9a25602ba898b1f84a6c41c3804758f6cd (diff)
rhi: Enhance the hdr info struct and add a manual test
...while sharing the related code between the d3d backends. The isHardCodedDefaults flag is not used in practice and is now removed. Add the luminance behavior and SDR white level (for Windows) to help creating portable 2D/3D renderers that composite SDR and HDR content. (sadly the Windows HDR and Apple EDR behavior is different, as usual) The new test application is expected to run with the command-line argument "scrgb" or "sdr". It allows seeing SDR content correction (on Windows) in action, and has some simple HDR 3D content with a basic, optional tonemapper. Also shows the platform-dependent HDR-related screen info. With some helpful tooltips even. Additionally, it needs a .hdr file after the 'file' argument. The usual -d, -D, -v, etc. arguments apply to select the 3D API. For example, to run with D3D12 in HDR mode: hdr -D scrgb file image.hdr The same in non-HDR mode: hdr -D sdr file image.hdr Change-Id: I7fdfc7054cc0352bc99398fc1c7b1e2f0874421f Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi.h')
-rw-r--r--src/gui/rhi/qrhi.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhi.h b/src/gui/rhi/qrhi.h
index 2d5ee7346e..2a4c16b881 100644
--- a/src/gui/rhi/qrhi.h
+++ b/src/gui/rhi/qrhi.h
@@ -1480,11 +1480,16 @@ Q_DECLARE_TYPEINFO(QRhiGraphicsPipeline::TargetBlend, Q_RELOCATABLE_TYPE);
struct QRhiSwapChainHdrInfo
{
- bool isHardCodedDefaults;
enum LimitsType {
LuminanceInNits,
ColorComponentValue
};
+
+ enum LuminanceBehavior {
+ SceneReferred,
+ DisplayReferred
+ };
+
LimitsType limitsType;
union {
struct {
@@ -1496,6 +1501,8 @@ struct QRhiSwapChainHdrInfo
float maxPotentialColorComponentValue;
} colorComponentValue;
} limits;
+ LuminanceBehavior luminanceBehavior;
+ float sdrWhiteLevel;
};
Q_DECLARE_TYPEINFO(QRhiSwapChainHdrInfo, Q_RELOCATABLE_TYPE);