Mesa (master): intel: Don' t _mesa_problem when asked for an RB of a texturing-only type.

Eric Anholt anholt at kemper.freedesktop.org
Wed Nov 9 20:28:57 UTC 2011


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Nov  8 11:19:45 2011 -0800

intel: Don't _mesa_problem when asked for an RB of a texturing-only type.

We want to be able to support some formats for texturing that we can't
render to, which means that some choices for RenderbufferStorage end
up being incomplete (for example, L8 currently).  For these, where we
don't render to them, we don't want to have to make up an rb->DataType
that's only used for GetRow()/PutRow().

---

 src/mesa/drivers/dri/intel/intel_span.c       |    7 +++++++
 src/mesa/drivers/dri/intel/intel_tex_format.c |    6 ++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index 604962d..191f776 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -436,4 +436,11 @@ intel_set_span_functions(struct intel_context *intel,
 
    assert(intel_span_init_funcs[irb->Base.Format]);
    intel_span_init_funcs[irb->Base.Format](rb);
+
+   if (rb->DataType == GL_NONE) {
+      _mesa_problem(NULL,
+		    "renderbuffer format %s is missing "
+		    "intel_mesa_format_to_rb_datatype() support.",
+		    _mesa_get_format_name(rb->Format));
+   }
 }
diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c
index 6890a69..a9f4981 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_format.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_format.c
@@ -42,8 +42,10 @@ intel_mesa_format_to_rb_datatype(gl_format format)
       return GL_FLOAT;
 
    default:
-      _mesa_problem(NULL, "unexpected MESA_FORMAT for renderbuffer");
-      return GL_UNSIGNED_BYTE;
+      /* Unsupported format.  We may hit this when people ask for FBO-incomplete
+       * formats.
+       */
+      return GL_NONE;
    }
 }
 




More information about the mesa-commit mailing list