aboutsummaryrefslogtreecommitdiff
path: root/render/vulkan
diff options
context:
space:
mode:
authorLeo Li <sunpeng.li@amd.com>2024-01-31 12:30:16 -0500
committerLeo Li <sunpeng.li@amd.com>2024-01-31 13:47:17 -0500
commit71fb55f3bf4341d250b580cb2d6a7acf21cfce39 (patch)
treedb4857073939915043ebbe7e319b7c37c75613be /render/vulkan
parent3a91dc1b483fbcb480c69b4dd2af1073cf69b52f (diff)
render/pixel-format: Move has_alpha into it's own array
Some opaque pixel formats (nv12, p010) require per-plane bytes_per_block info. However, it doesn't make sense to store them in wlr_pixel_format_info, as they will never be useful (currently, this info is used for shm, which doesn't have a concept of multi-planar buffers.) Let's define a separate array and function for determining whether a pixel format has alpha.
Diffstat (limited to 'render/vulkan')
-rw-r--r--render/vulkan/texture.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/render/vulkan/texture.c b/render/vulkan/texture.c
index 61c14626..a3fede04 100644
--- a/render/vulkan/texture.c
+++ b/render/vulkan/texture.c
@@ -382,7 +382,7 @@ static void texture_set_format(struct wlr_vk_texture *texture,
const struct wlr_pixel_format_info *format_info =
drm_get_pixel_format_info(format->drm);
if (format_info != NULL) {
- texture->has_alpha = format_info->has_alpha;
+ texture->has_alpha = pixel_format_has_alpha(format->drm);
} else {
// We don't have format info for multi-planar formats
assert(texture->format->is_ycbcr);