[Development] Does QSGPlainTexture needs call setHasAlphaChannel on Vulkan renderer?

Eskil Abrahamsen Blomfeldt Eskil.Abrahamsen-Blomfeldt at qt.io
Wed Oct 26 12:20:30 CEST 2022


Hi,

If the texture does not have alpha, that means we can do disable blending, do front-to-back sorting to minimize overdraw, and use depth-buffer checks to preserve stacking. So in the case where you know there is no alpha, this is an optimization. If you do not know whether or not there is an alpha, the safe choice is to assume that there is an alpha channel. Even if all the alpha values are at 100% opacity, the alpha-blending will still give the right results, whereas unblended opaque rendering will only be correct if the texture is completely opaque.


Eskil Abrahamsen Blomfeldt
Senior Manager, Graphics

The Qt Company
Sandakerveien 116
0484 Oslo, Norway
eskil.abrahamsen-blomfeldt at qt.io
http://qt.io

________________________________
Fra: Development <development-bounces at qt-project.org> på vegne av JiDe Zhang <zccrs at live.com>
Sendt: onsdag 26. oktober 2022 10:13
Til: Qt邮件列表 <development at qt-project.org>
Emne: [Development] Does QSGPlainTexture needs call setHasAlphaChannel on Vulkan renderer?

Hi, I am working for wlroots with Qt. In this https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3538#note_1604273  patch, I am exporting some interfaces in wlroots for vulkan, and using it with QtQuick, I want to get the has_alpha value of texture, but Simon Ser thinks we shouldn't need know has_alpha value of vulkan texture.

If I don't call setHasAlphaChannel for QSGPlainTexture, and if the texture is having alpha, then I will see the wrong display effective.

So, Is it a Qt bug? Although I don't think it's a Qt bug, but I can't get has alpha of texture from wlroots in vulkan.

How should I do?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20221026/0b5cd5cd/attachment.htm>


More information about the Development mailing list