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.
This commit is contained in:
Christian Hergert 2020-11-16 09:26:07 -08:00
parent 5e9883453d
commit 12a9164414

View File

@ -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;
}