Mesa (master): mesa: fix incorrect GL_DEPTH_STENCIL_ATTACHMENT format check
Brian Paul
brianp at kemper.freedesktop.org
Thu May 27 19:11:35 UTC 2010
Module: Mesa
Branch: master
Commit: a504f2387e2bb47025c7406d9a466a042dc09e61
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a504f2387e2bb47025c7406d9a466a042dc09e61
Author: Brian Paul <brianp at vmware.com>
Date: Thu May 27 13:05:23 2010 -0600
mesa: fix incorrect GL_DEPTH_STENCIL_ATTACHMENT format check
We want to check the incoming renderbuffer format, not the (potentially
non-existant) current attachment.
Fixes segfault w/ fbotexture -ds2.
NOTE: this will be applied to the 7.8 branch too.
---
src/mesa/main/fbobject.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index bf445d2..bc4741b 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1802,10 +1802,10 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
rb = NULL;
}
- if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ if (attachment == GL_DEPTH_STENCIL_ATTACHMENT &&
+ rb && rb->Format != MESA_FORMAT_NONE) {
/* make sure the renderbuffer is a depth/stencil format */
- const GLenum baseFormat =
- _mesa_get_format_base_format(att->Renderbuffer->Format);
+ const GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
if (baseFormat != GL_DEPTH_STENCIL) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glFramebufferRenderbufferEXT(renderbuffer"
More information about the mesa-commit
mailing list