aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Li <sunpeng.li@amd.com>2024-01-31 14:15:00 -0500
committerSimon Ser <contact@emersion.fr>2024-01-31 20:27:22 +0100
commit60af3b6b78365f26247187593fbb722515719027 (patch)
treeec1df40c6573e22d4771e2257f8254a452550b3b
parent71fb55f3bf4341d250b580cb2d6a7acf21cfce39 (diff)
render/gles2: Fixup dropping has_alpha from pixel_format
Fixes: 71fb55f3 ("render/pixel-format: Move has_alpha into it's own array")
-rw-r--r--render/gles2/pixel_format.c4
-rw-r--r--render/gles2/texture.c2
2 files changed, 2 insertions, 4 deletions
diff --git a/render/gles2/pixel_format.c b/render/gles2/pixel_format.c
index 1d9884e3..5cdf8c99 100644
--- a/render/gles2/pixel_format.c
+++ b/render/gles2/pixel_format.c
@@ -141,9 +141,7 @@ const struct wlr_gles2_pixel_format *get_gles2_format_from_gl(
continue;
}
- const struct wlr_pixel_format_info *drm_fmt =
- drm_get_pixel_format_info(formats[i].drm_format);
- if (drm_fmt->has_alpha != alpha) {
+ if (pixel_format_has_alpha(formats[i].drm_format) != alpha) {
continue;
}
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index e4caf6ca..d66e9c16 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -330,7 +330,7 @@ static struct wlr_texture *gles2_texture_from_pixels(
return NULL;
}
texture->target = GL_TEXTURE_2D;
- texture->has_alpha = drm_fmt->has_alpha;
+ texture->has_alpha = pixel_format_has_alpha(fmt->drm_format);
texture->drm_format = fmt->drm_format;
GLint internal_format = fmt->gl_internalformat;