gsk: Generate mipmaps when requested
authorMatthias Clasen <mclasen@redhat.com>
Wed, 8 Feb 2023 00:24:08 +0000 (19:24 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 11 Feb 2023 14:29:03 +0000 (09:29 -0500)
If the min_filter requires it, call
glGenerateMipmap for our textures.

gsk/gl/gskglcommandqueue.c

index 37f3243c4b38993feefa1612699d067fedc53a89..673958e5790ecdda07052f26a27ff20c6d6e4c9e 100644 (file)
@@ -1463,6 +1463,9 @@ gsk_gl_command_queue_upload_texture (GskGLCommandQueue *self,
 
   gsk_gl_command_queue_do_upload_texture (self, texture);
 
+  if (min_filter == GL_LINEAR_MIPMAP_LINEAR)
+    glGenerateMipmap (GL_TEXTURE_2D);
+
   /* Restore previous texture state if any */
   if (self->attachments->textures[0].id > 0)
     glBindTexture (self->attachments->textures[0].target,