Mesa (arb_fbo): i965: disallow separate depth/stencil renderbuffers
Brian Paul
brianp at kemper.freedesktop.org
Wed Jan 21 23:32:23 UTC 2009
Module: Mesa
Branch: arb_fbo
Commit: 44f530cc7930365752afb4fcaf434f1734298152
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=44f530cc7930365752afb4fcaf434f1734298152
Author: Brian Paul <brianp at vmware.com>
Date: Wed Jan 21 16:31:48 2009 -0700
i965: disallow separate depth/stencil renderbuffers
Take advantage of the GL_FRAMEBUFFER_UNSUPPORTED feature to disallow separate
depth and stencil renderbuffers; only allow combined depth/stencil buffers.
Next up: remove/simplify a bunch of the depth/stencil renderbuffer code.
Also: restore the previously disabled GL_DEPTH_COMPONENT16 case
---
src/mesa/drivers/dri/intel/intel_fbo.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index ab05871..c987882 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -205,18 +205,11 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
cpp = 4;
break;
case GL_DEPTH_COMPONENT16:
-#if 0
rb->_ActualFormat = GL_DEPTH_COMPONENT16;
rb->DataType = GL_UNSIGNED_SHORT;
rb->DepthBits = 16;
cpp = 2;
break;
-#else
- /* fall-through.
- * 16bpp depth renderbuffer can't be paired with a stencil buffer so
- * always used combined depth/stencil format.
- */
-#endif
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32:
@@ -673,10 +666,17 @@ intel_finish_render_texture(GLcontext * ctx,
static void
intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
{
- /* no-op for now.
- * Eventually: examine the renderbuffers/textures and make sure it's
- * supported by the hw.
- */
+ const struct intel_renderbuffer *depthRb =
+ intel_get_renderbuffer(fb, BUFFER_DEPTH);
+ const struct intel_renderbuffer *stencilRb =
+ intel_get_renderbuffer(fb, BUFFER_STENCIL);
+
+ if (stencilRb && stencilRb != depthRb) {
+ /* we only support combined depth/stencil buffers, not separate
+ * stencil buffers.
+ */
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
}
More information about the mesa-commit
mailing list