diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-01-05 15:48:46 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-01-11 22:38:35 +0100 |
commit | cdfbe7092304c3677e8fae95892f53852a90adfc (patch) | |
tree | bd6cb326fd2d0cf3edbb9254021f2d4f36efbb75 /src/gui/rhi/qrhi.cpp | |
parent | 0be28d103089a1c5e196e6e722878f495dfc53ce (diff) |
rhi: Improve the handling of HDR capable texture formats
Add some sort of autotest for both RGBA16F and the new RGB10A2. The
latter is introduced particularly because ideally we should have a
texture format that corresponds to the D3D/Vulkan swapchain color
buffer format with HDR10.
Change-Id: I1e1bbb7c7e32cb3db89275900811c0bcaeac39d6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi.cpp')
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 82c1de31f3..1585b4bbc0 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -2525,6 +2525,19 @@ bool QRhiRenderBuffer::createFrom(NativeRenderBuffer src) \value RGBA32F Four components, 32-bit float per component. + \value R16F One component, 16-bit float. + + \value R32F One component, 32-bit float. + + \value RGBA10A2 Four components, unsigned normalized 10 bit R, G, and B, + 2-bit alpha. This is a packed format so native endianness applies. Note + that there is no BGR30A2: this format maps to DXGI_FORMAT_R10G10B10A2_UNORM + with D3D, MTLPixelFormatRGB10A2Unorm with Metal, + VK_FORMAT_A2B10G10R10_UNORM_PACK32 with Vulkan, and + GL_RGB10_A2/GL_RGB/GL_UNSIGNED_INT_2_10_10_10_REV on OpenGL (ES). This is + the only universally supported RGB30 option. The corresponding QImage + formats are QImage::Format_BGR30 and QImage::Format_A2BGR30_Premultiplied. + \value D16 16-bit depth (normalized unsigned integer) \value D24 24-bit depth (normalized unsigned integer) @@ -5032,6 +5045,10 @@ void QRhiImplementation::textureFormatInfo(QRhiTexture::Format format, const QSi bpc = 4; break; + case QRhiTexture::RGB10A2: + bpc = 4; + break; + case QRhiTexture::D16: bpc = 2; break; |