[Development] HDR Support in Qt and Angle

Boudewijn Rempt boud at valdyas.org
Mon Nov 26 12:23:15 CET 2018

On maandag 26 november 2018 09:10:33 CET Allan Sandfeld Jensen wrote:

> I have been working on it and have a plan for it.  The first steps is a
> color space system, see https://codereview.qt-project.org/234095.
> Then the very basic of extended colors https://codereview.qt-project.org/
> 233735
> Next I have some work toward an 4xfp16 based rendering backend and image
> support, possibly removing the 4xuint16 backend at the same time so there is
> only one high-color precision backend.
> Then we just need a way to connect that to a backing store, such as using
> scRGB in OpenGL which looks like what you have been wokring on :)

Ah, no, that's not what we're doing. OpenGL simply does not support HDR at all 
in any meaningful way. Sending f16 textures looks like it works, on nvidia 
cards, but it will not work on an intel gpu. And scRGB is something that's 
very controversial -- Charles Poynton says this: https://twitter.com/momaku/

The only platform where HDR currently is supported is Windows 10 with 
Direct3D. See https://displayhdr.org/ . It's a really complex subject, there 
are very complex interactions between the monitor and the os, like described 
in https://docs.microsoft.com/en-us/windows/desktop/api/dxgi1_5/ns-dxgi1_5-dxgi_hdr_metadata_hdr10 .

We're also not really working on making QColor or QImage support f16 channels 
-- though another part of our project (https://phabricator.kde.org/T9256) is 
having gradients calculated correctly, and that would be helped by having 
QColor and QGradient support f16 or f32.

What we're currently trying to do is fix Qt and Angle so we can use HDR using 
OpenGL. As Dmitry described in https://dimula73.blogspot.com/2018/11/krita-fall-2018-sprint-results-hdr.html, that needs:

1    Create a DXGI swap chain with 10-bit or 16-bit pixel format
2    Set the color space of that swap chain to either p2020-pq (for 10-bit 
mode) or scRGB (for 16-bit mode).
3    Make sure all the intermediate textures/surfaces are rendered in 10/16-
bit mode (to avoid loss of precision)
4    Since the GUI is usually rendered on the same swap chain, one should also 
ensure that the GUI is converted from sRGB into the destination color space 
(either p2020-pq or scRGB)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20181126/065985be/attachment-0001.sig>

More information about the Development mailing list