Mesa (master): intel: Return success when asked to allocate a 0-width/ height renderbuffer.

Eric Anholt anholt at kemper.freedesktop.org
Fri May 4 21:21:28 UTC 2012


Module: Mesa
Branch: master
Commit: b7406404aba1817d5a87714f97a108a755943452
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b7406404aba1817d5a87714f97a108a755943452

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 23 14:14:11 2012 -0700

intel: Return success when asked to allocate a 0-width/height renderbuffer.

It seems silly that GL lets you allocate these given that they're
framebuffer attachment incomplete, but the webgl conformance tests
actually go looking to see if the getters on 0-width/height
depth/stencil renderbuffers return good values.  By failing out here,
they all got smashed to 0, which turned out to be correct for all the
getters they tested except for GL_RENDERBUFFER_INTERNAL_FORMAT.  Now,
by succeeding but not making a miptree, that one also returns the
expected value.

Acked-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/intel/intel_fbo.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 2d1a798..5872ece 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -237,6 +237,9 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer
        _mesa_lookup_enum_by_nr(internalFormat),
        _mesa_get_format_name(rb->Format), width, height);
 
+   if (width == 0 || height == 0)
+      return true;
+
    irb->mt = intel_miptree_create_for_renderbuffer(intel, rb->Format,
 						   width, height);
    if (!irb->mt)




More information about the mesa-commit mailing list