From b329256113e9af9edf148742b70b169f6b29bff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 19 Dec 2018 10:08:05 +0100 Subject: [PATCH] cogl/texture-2d-gl: Try to determine format for external textures Don't just set the internal format to the dummy format "any", as that causes code intended to be unreachable code to be reached. It's not possible to actually know the internal format of an external texture, however, so it might not actually correspond to the real format. https://gitlab.gnome.org/GNOME/mutter/merge_requests/362 --- cogl/cogl/driver/gl/cogl-texture-2d-gl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c index ba90998ba..ec9ed9e18 100644 --- a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c +++ b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c @@ -470,7 +470,12 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d, { CoglTexture *tex = COGL_TEXTURE (tex_2d); CoglContext *ctx = tex->context; - CoglPixelFormat internal_format = loader->src.egl_image_external.format; + CoglPixelFormat external_format; + CoglPixelFormat internal_format; + + external_format = loader->src.egl_image_external.format; + internal_format = _cogl_texture_determine_internal_format (tex, + external_format); _cogl_gl_util_clear_gl_errors (ctx);