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

Vulkan Validation Error in QQuickRenderTarget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.4.0 Beta1
    • 6.3.0
    • GUI: Vulkan, Qt RHI
    • None
    • All
    • 1df2cf6bad (qt/qtdeclarative/dev) 1acd68c04d (qt/qtdeclarative/dev)

    Description

      I use the QQuickRenderTarget::fromVulkanImage make a VkImage object to a QQuickWindow render target, but I get the follow error messages from the Vulkan:

      Vulkan Debug Log

      Validation Error: [ VUID-VkImageViewCreateInfo-image-01762 ] Object 0: handle = 0x967dd1000000000e, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x6516b437 | vkCreateImageView() format VK_FORMAT_R8G8B8A8_UNORM differs from VkImage 0x967dd1000000000e[] format VK_FORMAT_B8G8R8A8_SRGB. Formats MUST be IDENTICAL unless VK_IMAGE_CREATE_MUTABLE_FORMAT BIT was set on image creation. The Vulkan spec states: If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, or if the format of the image is a multi-planar format and if subresourceRange.aspectMask is VK_IMAGE_ASPECT_COLOR_BIT, format must be identical to the format used to create image (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkImageViewCreateInfo-image-01762) (VUID-VkImageViewCreateInfo-image-01762)

      The consequences of this bug can be seen here: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3538

      It tell me the VkFormat of VkImageView is not right, the source VkImage format is VK_FORMAT_B8G8R8A8_SRGB, but the VkImageViewCreateInfo provided "format" value is VK_FORMAT_R8G8B8A8_UNORM, and no ways to set the VkFormat of VkImage in QQuickRenderTarget. Other, the QSGPlainTexture::setTextureFromNativeTexture also can't custom the format of native texture. The QQuickRenderTargetPrivate::resolve and the QSGPlainTexture::setTextureFromNativeTexture always use the "QRhiTexture::RGBA8" and without "QRhiTexture::sRGB" flag for "QRhiTexture::createTexture". Do you think we can allow to custom the texture color format?

      Attachments

        Issue Links

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

          Activity

            People

              janichol Andy Nichols
              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