Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.3.0
-
None
-
-
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:
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
- resulted in
-
QTBUG-104741 Warning: GL Format 0 not supported
- Closed
For Gerrit Dashboard: QTBUG-103216 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
409573,4 | rhi: Allow specifies the native format on create QRhiTexture | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
409621,14 | Allow specifies the native texture format on QQuickRenderTarget | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
411358,5 | Allow specifies the native format on QSGPlainTexture | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |