[gtk/wip/chergert/for-master] gsk: use glFrameBufferTexture2D and release texture




commit 12a91644148a230aecab895f575e30f3e58576b0
Author: Christian Hergert <chergert redhat com>
Date:   Mon Nov 16 09:26:07 2020 -0800

    gsk: use glFrameBufferTexture2D and release texture
    
    glFrameBufferTexture maps to all faces of a cube and that is not needed
    here. Additionally, texture_id is not deleted after we use the additional
    flipped texture, but should be.

 gsk/gl/gskglrenderer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index a40df3c94e..15bad5feaa 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -4303,7 +4303,7 @@ gsk_gl_renderer_render_texture (GskRenderer           *renderer,
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
 
-    glFramebufferTexture (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, final_texture_id, 0);
+    glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, final_texture_id, 0);
     g_assert_cmphex (glCheckFramebufferStatus (GL_FRAMEBUFFER), ==, GL_FRAMEBUFFER_COMPLETE);
 
     ops_set_render_target (&self->op_builder, final_fbo_id);
@@ -4324,6 +4324,9 @@ gsk_gl_renderer_render_texture (GskRenderer           *renderer,
     gsk_gl_renderer_render_ops (self);
 
     ops_finish (&self->op_builder);
+
+    glDeleteTextures (1, &texture_id);
+
     texture_id = final_texture_id;
   }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]