gsk: Use matching memory format
authorMatthias Clasen <mclasen@redhat.com>
Mon, 29 May 2023 17:41:30 +0000 (13:41 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 30 May 2023 18:41:01 +0000 (14:41 -0400)
memory_format_gl_format returns the new memory
format if it made a change, we should not drop
that on the floor.

gsk/gl/gskglcommandqueue.c

index 4a19f59c4f05390a0c6004bf4e543c20d452c092..60e9222fe018cc71e67ba22c4131562b4ccee606 100644 (file)
@@ -1447,6 +1447,7 @@ gsk_gl_command_queue_create_framebuffer (GskGLCommandQueue *self)
   return fbo_id;
 }
 
+
 static GdkMemoryFormat
 memory_format_gl_format (GdkMemoryFormat  data_format,
                          gboolean         use_es,
@@ -1630,14 +1631,14 @@ gsk_gl_command_queue_upload_texture_chunks (GskGLCommandQueue    *self,
   use_es = gdk_gl_context_get_use_es (self->context);
   gdk_gl_context_get_version (self->context, &major, &minor);
   data_format = gdk_texture_get_format (chunks[0].texture);
-  memory_format_gl_format (data_format,
-                           use_es,
-                           major,
-                           minor,
-                           &gl_internalformat,
-                           &gl_format,
-                           &gl_type,
-                           &gl_swizzle);
+  data_format = memory_format_gl_format (data_format,
+                                         use_es,
+                                         major,
+                                         minor,
+                                         &gl_internalformat,
+                                         &gl_format,
+                                         &gl_type,
+                                         &gl_swizzle);
 
   glTexImage2D (GL_TEXTURE_2D, 0, gl_internalformat, width, height, 0, gl_format, gl_type, NULL);