[cogl/wip/gles2-context: 6/12] framebuffer: Enable a single depth and stencil buffer for GLES
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/gles2-context: 6/12] framebuffer: Enable a single depth and stencil buffer for GLES
- Date: Thu, 29 Dec 2011 09:55:15 +0000 (UTC)
commit cc9b9821235d0b645cf322e5e6ee4ec7d96741c7
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
https://bugzilla.gnome.org/show_bug.cgi?id=666184
cogl/cogl-ext-functions.h | 3 +++
cogl/cogl-framebuffer.c | 13 ++++++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/cogl/cogl-ext-functions.h b/cogl/cogl-ext-functions.h
index a9c2001..9f60bdd 100644
--- a/cogl/cogl-ext-functions.h
+++ b/cogl/cogl-ext-functions.h
@@ -655,6 +655,9 @@ COGL_EXT_BEGIN (blend_equation_separate, 2, 0,
COGL_EXT_FUNCTION (void, glBlendEquationSeparate,
(GLenum modeRGB,
GLenum modeAlpha))
+COGL_EXT_FUNCTION (void, glDetachShader,
+ (GLuint program,
+ GLuint shader))
COGL_EXT_END ()
COGL_EXT_BEGIN (EGL_image, 255, 255,
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 0817b4c..cadd6ae 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 /* FIXME: We should check GL_OES_packed_depth_stencil */
+ 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]