Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119193

QtQuick not supported sRGB render target

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.7.0 Beta1
    • Quick: SceneGraph
    • None
    • All

    Description

      I am using QQuickRenderTarget to perform off-screen rendering of a QQuickWindow's content. This QQuickRenderTarget comes from a VkImage, and the format of this VkImage is VK_FORMAT_B8G8R8A8_SRGB, representing it in the sRGB color space. Eventually, this VkImage with the VK_FORMAT_B8G8R8A8_SRGB format will be directly sent to the display. Yes, I am developing a Wayland compositor.

      Considering the characteristics of the sRGB space, I should apply gamma correction for each QQuickItem in this QQuickWindow. For instance, when creating a Vulkan texture for QQuickImage, QRhiTexture::sRGB should be enabled. The colors set for QQuickRectangle should also undergo gamma correction. Otherwise, the QQuickImage or QQuickRectangle displayed on the screen will appear brighter than expected, as it undergoes gamma adjustment erroneously twice.

      Although QQuickImageBase provides the colorSpace property for user utilization, this property may not be applicable in this case. Even if it were, users might not be able to use it because in a Wayland compositor, QQuickImage might not be directly used. It could be that only a Button control from QtQuick Controls is used within the Button control, utilizing an Image. However, the Wayland compositor cannot control it.

      I am unsure whether we can support such scenarios in Qt. For example, should Qt Shader Effects also adapt to sRGB rendering targets? I am uncertain about the extent of modifications required to support sRGB rendering targets. Alternatively, are we not planning to support sRGB rendering targets for QQuickWindow?

      Attachments

        1. It is incorrect.png
          It is incorrect.png
          456 kB
        2. It is right.png
          It is right.png
          535 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              lagocs Laszlo Agocs
              zccrs JiDe Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes