diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2012-05-25 14:55:36 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2012-07-11 18:21:56 +0100 |
commit | ff3707e3c065812960680b80a6bc1963d14b3a94 (patch) | |
tree | 9a057e72484af52bbb76b900d7fe4a9a5f423be5 | |
parent | 30c91bc6972b8cbb9d513940ef00806750b41fd0 (diff) | |
download | cogl-ff3707e3c065812960680b80a6bc1963d14b3a94.tar.gz |
Use the GL_DEPTH24_STENCIL8 internal format for packed buffers
GL_DEPTH_STENCIL is not a valid internal format according to
EXT_packed_depth_stencil. Let's use the the GL_DEPTH24_STENCIL8 internal
format defined by the extension (internal format also used by the OES
code path).
I've noticed this when trying to create a texture with this format as
internal format and it did not pass the GL_PROXY_TEXTURE_2D test.
glRenderBufferStorage() uses internal formats as well, so changing it to
GL_DEPTH24_STENCIL8 seemed like the natural thing to do.
-rw-r--r-- | cogl/cogl-framebuffer-private.h | 7 | ||||
-rw-r--r-- | cogl/cogl-framebuffer.c | 12 |
2 files changed, 7 insertions, 12 deletions
diff --git a/cogl/cogl-framebuffer-private.h b/cogl/cogl-framebuffer-private.h index 9922a1aa..ccc9c227 100644 --- a/cogl/cogl-framebuffer-private.h +++ b/cogl/cogl-framebuffer-private.h @@ -167,10 +167,9 @@ struct _CoglFramebuffer }; typedef enum { - COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH_STENCIL = 1L<<0, - COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH24_STENCIL8 = 1L<<1, - COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH = 1L<<2, - COGL_OFFSCREEN_ALLOCATE_FLAG_STENCIL = 1L<<3 + COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH24_STENCIL8 = 1L<<0, + COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH = 1L<<1, + COGL_OFFSCREEN_ALLOCATE_FLAG_STENCIL = 1L<<2 } CoglOffscreenAllocateFlags; typedef struct _CoglGLFramebuffer diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index 69333573..334f02b9 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -830,22 +830,18 @@ try_creating_renderbuffers (CoglContext *ctx, GList *renderbuffers = NULL; GLuint gl_depth_stencil_handle; - if (flags & (COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH_STENCIL | - COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH24_STENCIL8)) + if (flags & COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH24_STENCIL8) { - GLenum format = ((flags & COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH_STENCIL) ? - GL_DEPTH_STENCIL : GL_DEPTH24_STENCIL8); - /* Create a renderbuffer for depth and stenciling */ GE (ctx, glGenRenderbuffers (1, &gl_depth_stencil_handle)); GE (ctx, glBindRenderbuffer (GL_RENDERBUFFER, gl_depth_stencil_handle)); if (n_samples) GE (ctx, glRenderbufferStorageMultisampleIMG (GL_RENDERBUFFER, n_samples, - format, + GL_DEPTH24_STENCIL8, width, height)); else - GE (ctx, glRenderbufferStorage (GL_RENDERBUFFER, format, + GE (ctx, glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, height)); GE (ctx, glBindRenderbuffer (GL_RENDERBUFFER, 0)); GE (ctx, glFramebufferRenderbuffer (GL_FRAMEBUFFER, @@ -1079,7 +1075,7 @@ _cogl_offscreen_allocate (CoglOffscreen *offscreen, offscreen->texture_level_width, offscreen->texture_level_height, &fb->config, - flags = COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH_STENCIL, + flags = COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH24_STENCIL8, gl_framebuffer)) || ((ctx->private_feature_flags & |