From dde2d9b545d08168afe218f7bca900238782528e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 4 Jan 2024 09:06:19 +0100 Subject: [PATCH] gl: Don't initialize texture storage in wrong format We're calling glTexImage2D() right after with the correct format. So add the special format "0" to avoid intializing the texture memory. --- gsk/gl/gskglcommandqueue.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gsk/gl/gskglcommandqueue.c b/gsk/gl/gskglcommandqueue.c index c22ae00680..3db15181a3 100644 --- a/gsk/gl/gskglcommandqueue.c +++ b/gsk/gl/gskglcommandqueue.c @@ -1435,6 +1435,8 @@ gsk_gl_command_queue_create_texture (GskGLCommandQueue *self, switch (format) { + case 0: + break; case GL_RGBA8: glTexImage2D (GL_TEXTURE_2D, 0, format, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); break; @@ -1689,7 +1691,7 @@ gsk_gl_command_queue_upload_texture_chunks (GskGLCommandQueue *self, height = MIN (height, self->max_texture_size); } - texture_id = gsk_gl_command_queue_create_texture (self, width, height, GL_RGBA8); + texture_id = gsk_gl_command_queue_create_texture (self, width, height, 0); if (texture_id == -1) return texture_id;