diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-01-02 20:21:46 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-01-06 02:43:40 +0100 |
commit | 8efe2d54b7d0427badee1edee221849f19629845 (patch) | |
tree | df673cc49b96efb7a8b89bea45f4225963158778 /src/gui/rhi/qrhi.cpp | |
parent | abe802cd00bb28e95c63d318b0360db6fbf51666 (diff) |
rhi: Expose HDR output info in a saner way
Don't bother with exposing the IDXGIOutput6. Instead, report the values,
just the ones that matter for tonemapping or transfer functions in a
cross-platform way that's also prepared for Metal's different way of doing
things.
Change-Id: I28c7b6144f8267a9d3d44eff1e40697fb543385f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi.cpp')
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 408122f621..3da1edfdac 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -4465,17 +4465,36 @@ QRhiResource::Type QRhiSwapChain::resourceType() const Regardless of the return value, calling destroy() is always safe. */ -/*! - \return a pointer to a backend-specific QRhiNativeHandles subclass, such as - QRhiD3D11SwapChainNativeHandles. The returned value is \nullptr when - exposing the underlying native resources is not supported by the backend. +QRhiSwapChainHdrInfo QRhiSwapChain::hdrInfo() +{ + QRhiSwapChainHdrInfo info; + info.isHardCodedDefaults = true; + info.limitsType = QRhiSwapChainHdrInfo::LuminanceInNits; + info.limits.luminanceInNits.minLuminance = 0.0f; + info.limits.luminanceInNits.maxLuminance = 1000.0f; + return info; +} - \sa QRhiD3D11SwapChainNativeHandles - */ -const QRhiNativeHandles *QRhiSwapChain::nativeHandles() +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QRhiSwapChainHdrInfo &info) { - return nullptr; + QDebugStateSaver saver(dbg); + dbg.nospace() << "QRhiSwapChainHdrInfo(" << (info.isHardCodedDefaults ? "with hard-coded defaults" : "queried from system"); + switch (info.limitsType) { + case QRhiSwapChainHdrInfo::LuminanceInNits: + dbg.nospace() << " minLuminance=" << info.limits.luminanceInNits.minLuminance + << " maxLuminance=" << info.limits.luminanceInNits.maxLuminance; + break; + case QRhiSwapChainHdrInfo::ColorComponentValue: + dbg.nospace() << " maxColorComponentValue=" << info.limits.colorComponentValue.maxColorComponentValue; + break; + default: + break; + } + dbg.nospace() << ')'; + return dbg; } +#endif /*! \class QRhiComputePipeline |