render/vulkan: add wlr_vk_texture_has_alpha

Allow to get whether has alpha channel of the VkImage, it can help an
optimization to disable blending when the texture doesn't have alpha.
Because the VkFormat isn't enough because it's always set to
VK_FORMAT_B8G8R8A8_SRGB or VK_FORMAT_R8G8B8A8_SRGB.
This commit is contained in:
zccrs 2022-11-09 17:57:56 +08:00
parent 65836ce357
commit 5b34fe5513
3 changed files with 11 additions and 2 deletions

View file

@ -253,6 +253,7 @@ struct wlr_vk_texture {
bool dmabuf_imported;
bool owned; // if dmabuf_imported: whether we have ownership of the image
bool transitioned; // if dma_imported: whether we transitioned it away from preinit
bool has_alpha; // whether the image is has alpha channel
struct wl_list foreign_link; // wlr_vk_renderer.foreign_textures
struct wl_list destroy_link; // wlr_vk_renderer.destroy_textures
struct wl_list link; // wlr_vk_renderer.textures