[Mesa-dev] [PATCH 2/3] intel: Report FBO incompleteness causes through GL_ARB_debug_output.

Kenneth Graunke kenneth at whitecape.org
Fri Apr 26 09:33:34 PDT 2013


On 04/25/2013 01:20 PM, Eric Anholt wrote:
> ---
>   src/mesa/drivers/dri/intel/intel_fbo.c |   56 +++++++++++++++++++-------------
>   1 file changed, 34 insertions(+), 22 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
> index 9fcee14..15d3918 100644
> --- a/src/mesa/drivers/dri/intel/intel_fbo.c
> +++ b/src/mesa/drivers/dri/intel/intel_fbo.c
> @@ -701,6 +701,18 @@ intel_finish_render_texture(struct gl_context * ctx,
>      intel_batchbuffer_emit_mi_flush(intel);
>   }
>
> +#define fbo_incomplete(fb, ...) do {                                          \
> +      static GLuint msg_id = 0;                                               \
> +      if (unlikely(ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT)) {    \
> +         _mesa_gl_debug(ctx, &msg_id,                                         \
> +                        MESA_DEBUG_TYPE_OTHER,                                \
> +                        MESA_DEBUG_SEVERITY_MEDIUM,                           \
> +                        __VA_ARGS__);                                         \
> +      }                                                                       \
> +      DBG(__VA_ARGS__);                                                       \
> +      fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;                               \
> +   } while (0)
> +
>   /**
>    * Do additional "completeness" testing of a framebuffer object.
>    */
> @@ -735,22 +747,23 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
>   	  */
>   	 if (depthRb->mt_level != stencilRb->mt_level ||
>   	     depthRb->mt_layer != stencilRb->mt_layer) {
> -	    DBG("depth image level/layer %d/%d != stencil image %d/%d\n",
> -		depthRb->mt_level,
> -		depthRb->mt_layer,
> -		stencilRb->mt_level,
> -		stencilRb->mt_layer);
> -	    fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
> +	    fbo_incomplete(fb,
> +                           "FBO incomplete: depth image level/layer %d/%d != "
> +                           "stencil image %d/%d\n",
> +                           depthRb->mt_level,
> +                           depthRb->mt_layer,
> +                           stencilRb->mt_level,
> +                           stencilRb->mt_layer);
>   	 }
>         } else {
>   	 if (!intel->has_separate_stencil) {
> -	    DBG("separate stencil unsupported\n");
> -	    fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
> +	    fbo_incomplete(fb, "FBO incomplete: separate stencil "
> +                           "unsupported\n");

I'm not sure this can ever happen, but regardless...

- Really glad to see more ARB_debug_output - this'll be incredibly 
useful for application authors
- Glad to see ARB_color_buffer_float dropped too!

All three are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list