[cogl/wip/gles2-context] framebuffer: Enable a single depth and stencil buffer for GLES



commit f37b33f66b9c5d5cfa6c76403fb6b8e8b1d5f5c8
Author: Tomeu Vizoso <tomeu vizoso collabora com>
Date:   Wed Dec 14 12:22:05 2011 +0100

    framebuffer: Enable a single depth and stencil buffer for GLES
    
    It is supported for the GL_DEPTH24_STENCIL8_OES format

 cogl/cogl-framebuffer.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 0817b4c..32cfac2 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -886,9 +886,15 @@ try_creating_fbo (CoglOffscreen *offscreen,
                                                       n_samples,
                                                       GL_DEPTH_STENCIL,
                                                       width, height));
-      else
+#ifdef HAVE_COGL_GL
+      else if (ctx->driver == COGL_DRIVER_GL)
         GE (ctx, glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH_STENCIL,
                                         width, height));
+#endif
+      else
+        GE (ctx, glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES,
+                                        width, height));
+
       GE (ctx, glBindRenderbuffer (GL_RENDERBUFFER, 0));
       GE (ctx, glFramebufferRenderbuffer (GL_FRAMEBUFFER,
                                           GL_STENCIL_ATTACHMENT,
@@ -1009,10 +1015,7 @@ _cogl_offscreen_allocate (CoglOffscreen *offscreen,
     {
       if ((have_working_flags &&
            try_creating_fbo (offscreen, flags)) ||
-#ifdef HAVE_COGL_GL
-          (ctx->driver == COGL_DRIVER_GL &&
-           try_creating_fbo (offscreen, flags = _TRY_DEPTH_STENCIL)) ||
-#endif
+          try_creating_fbo (offscreen, flags = _TRY_DEPTH_STENCIL) ||
           try_creating_fbo (offscreen, flags = _TRY_DEPTH | _TRY_STENCIL) ||
           try_creating_fbo (offscreen, flags = _TRY_STENCIL) ||
           try_creating_fbo (offscreen, flags = _TRY_DEPTH) ||



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