[cairo] [patch] gl/msaa: release msaa_depth_stencil buffer under GLESv2

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Thu Oct 18 07:33:05 PDT 2012


Hi, Andrei

Thanks for patch.  The msaa compositor in cairo upstream is not complete/optimized, we will upstream our msaa compositor (http://code.google.com/g/cairogles, checkout release-1.12.4 branch which is synched with cairo 1.12.4) once we have our urgent work done.  In fact, we have changed the stencil buffer design such that it uses shared stencil buffer instead of each surface has its own dedicated stencil buffer to reduce memory consumption.

Please use our cairo gl/msaa backend for the moment until we completely upstream our code. it supports both GL_EXT_multisampled_render_to_texture and GL_IMG_multisampled_render_to_texture.

Henry

________________________________________
From: cairo-bounces+hsong=sisa.samsung.com at cairographics.org [cairo-bounces+hsong=sisa.samsung.com at cairographics.org] on behalf of Andrei Volykhin [andrei.volykhin at gmail.com]
Sent: Thursday, October 18, 2012 5:07 AM
To: cairo at cairographics.org
Subject: [cairo] [patch] gl/msaa: release msaa_depth_stencil buffer under       GLESv2

diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index c0ee79f..5c2a597 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -973,9 +973,9 @@ _cairo_gl_surface_finish (void *abstract_surface)
     if (surface->owns_tex)
        glDeleteTextures (1, &surface->tex);

-#if CAIRO_HAS_GL_SURFACE
     if (surface->msaa_depth_stencil)
        ctx->dispatch.DeleteRenderbuffers (1, &surface->msaa_depth_stencil);
+#if CAIRO_HAS_GL_SURFACE
     if (surface->msaa_fb)
        ctx->dispatch.DeleteFramebuffers (1, &surface->msaa_fb);
     if (surface->msaa_rb)


If cairo will be configured with next options: ./confugire --enable-gl=no --enable-glesv2=yes --enable-egl=yes, and we'll use gl/msaa compositor (export CAIRO_GL_COMPOSITOR=msaa)
and GL_RENDERER support next extension - "GL_IMG_multisampled_render_to_texture" or "GL_EXT_multisampled_render_to_texture", we'll get memory leaks on embedded devices (GLESv2).


More information about the cairo mailing list