aboutsummaryrefslogtreecommitdiff
path: root/render/vulkan
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-06-16 14:43:24 +0200
committerSimon Ser <contact@emersion.fr>2022-06-16 14:43:24 +0200
commit29291cb47cdaa72d1142a008fef3301dcb86dfac (patch)
tree77616ce5285dea16bc1ebe1a41e02b1ed3b80ce6 /render/vulkan
parentf28c0e2046c59aeb9f014ef4c22d4517e38f4721 (diff)
render/texture: drop wlr_texture_is_opaque
Whether a texture is opaque or not doesn't depend on the renderer at all, it just depends on the source buffer. Instead of forcing all renderers to implement wlr_texture_impl.is_opaque, let's move this in common code and use the wlr_buffer format to know whether a texture will be opaque.
Diffstat (limited to 'render/vulkan')
-rw-r--r--render/vulkan/texture.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/render/vulkan/texture.c b/render/vulkan/texture.c
index 26af9867..35b9562e 100644
--- a/render/vulkan/texture.c
+++ b/render/vulkan/texture.c
@@ -33,14 +33,6 @@ static VkImageAspectFlagBits mem_plane_aspect(unsigned i) {
}
}
-static bool vulkan_texture_is_opaque(struct wlr_texture *wlr_texture) {
- struct wlr_vk_texture *texture = vulkan_get_texture(wlr_texture);
- const struct wlr_pixel_format_info *format_info = drm_get_pixel_format_info(
- texture->format->drm_format);
- assert(format_info);
- return !format_info->has_alpha;
-}
-
// Will transition the texture to shaderReadOnlyOptimal layout for reading
// from fragment shader later on
static bool write_pixels(struct wlr_texture *wlr_texture,
@@ -199,7 +191,6 @@ static void vulkan_texture_unref(struct wlr_texture *wlr_texture) {
}
static const struct wlr_texture_impl texture_impl = {
- .is_opaque = vulkan_texture_is_opaque,
.write_pixels = vulkan_texture_write_pixels,
.destroy = vulkan_texture_unref,
};