[Mesa-dev] [PATCH] intel: Also check renderability in intel_renderbuffer_update_wrapper

Ian Romanick idr at freedesktop.org
Wed Feb 1 11:29:39 PST 2012

From: Ian Romanick <ian.d.romanick at intel.com>

A similar check was removed in 05ab8fc.  The check is not complete
redundand because some paths, such as
_mesa_meta_check_generate_mipmap_fallback, can get to
intel_renderbuffer_update_wrapper but not get to
intel_validate_framebuffer.  This occurs when trying to generate
mipmaps for GL_SLUMINANCE8 textures.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44961
Cc: Eric Anholt <eric at anholt.net>
 src/mesa/drivers/dri/intel/intel_fbo.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 62ed754..c235fb4 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -482,6 +482,12 @@ intel_renderbuffer_update_wrapper(struct intel_context *intel,
    rb->Delete = intel_delete_renderbuffer;
    rb->AllocStorage = intel_nop_alloc_storage;
+   if (!intel->vtbl.render_target_supported(intel, rb)) {
+      DBG("Render to texture BAD FORMAT %s\n",
+	  _mesa_get_format_name(rb->Format));
+      return false;
+   }
    intel_miptree_check_level_layer(mt, level, layer);
    irb->mt_level = level;
    irb->mt_layer = layer;

More information about the mesa-dev mailing list