diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c index 2d0b2c1ffd..715077469c 100644 --- a/gdk/gdkgltexture.c +++ b/gdk/gdkgltexture.c @@ -161,7 +161,12 @@ gdk_gl_texture_find_format (GdkGLContext *context, if (!(gdk_gl_context_get_format_flags (context, format) & GDK_GL_FORMAT_RENDERABLE)) continue; - gdk_memory_format_gl_format (format, &q_internal_format, &q_format, &q_type, q_swizzle); + gdk_memory_format_gl_format (format, + gdk_gl_context_get_use_es (context), + &q_internal_format, + &q_format, + &q_type, + q_swizzle); if (q_format != gl_format || q_type != gl_type) continue; @@ -193,6 +198,7 @@ gdk_gl_texture_do_download (GdkGLTexture *self, ((gdk_gl_context_get_format_flags (context, format) & GDK_GL_FORMAT_USABLE) == GDK_GL_FORMAT_USABLE)) { gdk_memory_format_gl_format (format, + gdk_gl_context_get_use_es (context), &gl_internal_format, &gl_format, &gl_type, gl_swizzle); if (download->stride == expected_stride && @@ -255,6 +261,7 @@ gdk_gl_texture_do_download (GdkGLTexture *self, actual_format = gdk_memory_format_get_straight (actual_format); gdk_memory_format_gl_format (actual_format, + gdk_gl_context_get_use_es (context), &gl_internal_format, &gl_read_format, &gl_read_type, gl_swizzle); } @@ -266,6 +273,7 @@ gdk_gl_texture_do_download (GdkGLTexture *self, actual_format = gdk_memory_format_get_straight (actual_format); gdk_memory_format_gl_format (actual_format, + gdk_gl_context_get_use_es (context), &gl_internal_format, &gl_read_format, &gl_read_type, gl_swizzle); } diff --git a/gdk/gdkmemoryformat.c b/gdk/gdkmemoryformat.c index 9743a31dba..12da940fb4 100644 --- a/gdk/gdkmemoryformat.c +++ b/gdk/gdkmemoryformat.c @@ -1473,6 +1473,7 @@ gdk_memory_depth_get_alpha_format (GdkMemoryDepth depth) void gdk_memory_format_gl_format (GdkMemoryFormat format, + gboolean gles, GLint *out_internal_format, GLenum *out_format, GLenum *out_type, @@ -1487,6 +1488,7 @@ gdk_memory_format_gl_format (GdkMemoryFormat format, /* * gdk_memory_format_gl_rgba_format: * @format: The format to query + * @gles: TRUE for GLES, FALSE for GL * @out_actual_format: The actual RGBA format * @out_internal_format: the GL internal format * @out_format: the GL format @@ -1504,6 +1506,7 @@ gdk_memory_format_gl_format (GdkMemoryFormat format, **/ gboolean gdk_memory_format_gl_rgba_format (GdkMemoryFormat format, + gboolean gles, GdkMemoryFormat *out_actual_format, GLint *out_internal_format, GLenum *out_format, diff --git a/gdk/gdkmemoryformatprivate.h b/gdk/gdkmemoryformatprivate.h index 063ed85da2..a3ecdb7bb8 100644 --- a/gdk/gdkmemoryformatprivate.h +++ b/gdk/gdkmemoryformatprivate.h @@ -55,11 +55,13 @@ GdkMemoryDepth gdk_memory_depth_merge (GdkMemoryDepth GdkMemoryFormat gdk_memory_depth_get_format (GdkMemoryDepth depth) G_GNUC_CONST; GdkMemoryFormat gdk_memory_depth_get_alpha_format (GdkMemoryDepth depth) G_GNUC_CONST; void gdk_memory_format_gl_format (GdkMemoryFormat format, + gboolean gles, GLint *out_internal_format, GLenum *out_format, GLenum *out_type, GLint out_swizzle[4]); gboolean gdk_memory_format_gl_rgba_format (GdkMemoryFormat format, + gboolean gles, GdkMemoryFormat *out_actual_format, GLint *out_internal_format, GLenum *out_format, diff --git a/gsk/gl/gskglcommandqueue.c b/gsk/gl/gskglcommandqueue.c index 3db15181a3..1ebaef2108 100644 --- a/gsk/gl/gskglcommandqueue.c +++ b/gsk/gl/gskglcommandqueue.c @@ -1504,6 +1504,7 @@ memory_format_gl_format (GskGLCommandQueue *self, if ((flags & required_flags) == required_flags) { gdk_memory_format_gl_format (data_format, + gdk_gl_context_get_use_es (self->context), gl_internalformat, gl_format, gl_type, @@ -1514,6 +1515,7 @@ memory_format_gl_format (GskGLCommandQueue *self, /* Second, try the potential RGBA format */ if (gdk_memory_format_gl_rgba_format (data_format, + gdk_gl_context_get_use_es (self->context), &alt_format, gl_internalformat, gl_format, @@ -1529,6 +1531,7 @@ memory_format_gl_format (GskGLCommandQueue *self, return data_format; gdk_memory_format_gl_format (alt_format, + gdk_gl_context_get_use_es (self->context), gl_internalformat, gl_format, gl_type, @@ -1546,6 +1549,7 @@ memory_format_gl_format (GskGLCommandQueue *self, if (((flags & required_flags) == required_flags)) { gdk_memory_format_gl_format (fallbacks[i], + gdk_gl_context_get_use_es (self->context), gl_internalformat, gl_format, gl_type, diff --git a/gsk/gpu/gskgldevice.c b/gsk/gpu/gskgldevice.c index 92567970c5..78b7fbfc8a 100644 --- a/gsk/gpu/gskgldevice.c +++ b/gsk/gpu/gskgldevice.c @@ -638,6 +638,7 @@ gsk_gl_device_find_gl_format (GskGLDevice *self, *out_format = format; *out_flags = flags; gdk_memory_format_gl_format (format, + gdk_gl_context_get_use_es (context), out_gl_internal_format, out_gl_format, out_gl_type, @@ -647,6 +648,7 @@ gsk_gl_device_find_gl_format (GskGLDevice *self, /* Second, try the potential RGBA format */ if (gdk_memory_format_gl_rgba_format (format, + gdk_gl_context_get_use_es (context), &alt_format, out_gl_internal_format, out_gl_format, @@ -670,6 +672,7 @@ gsk_gl_device_find_gl_format (GskGLDevice *self, *out_format = fallbacks[i]; *out_flags = flags; gdk_memory_format_gl_format (fallbacks[i], + gdk_gl_context_get_use_es (context), out_gl_internal_format, out_gl_format, out_gl_type,