[Mesa-dev] [PATCH] intel: Emit assertion failure ASAP when DRI2 separate stencil handshake fails

Kenneth Graunke kenneth at whitecape.org
Thu Aug 18 22:47:58 PDT 2011


On 08/18/2011 02:02 PM, Chad Versace wrote:
> When intel_verify_dri2_has_hiz() discovers that DRI2 (that is, the DDX
> driver) cannot provide a separate stencil buffer, but
> intel_context::hw_must_use_separate_stencil is set, then emit an
> informative assertion failure as soon as possible.
> 
> Currently, we do emit an assertion failure, but the its location is
> sufficiently unrelated to the DRI2 HiZ handshake as to be uninformative.
> In experimenting with HiZ, Anholt encountered this assertion failure and
> was unable to understand its cause.
> 
> CC: Eric Anholt <eric at anholt.net>
> Signed-off-by: Chad Versace <chad at chad-versace.us>
> ---
>  src/mesa/drivers/dri/intel/intel_context.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
> index fe8be08..b9d2579 100644
> --- a/src/mesa/drivers/dri/intel/intel_context.c
> +++ b/src/mesa/drivers/dri/intel/intel_context.c
> @@ -1454,6 +1454,10 @@ intel_verify_dri2_has_hiz(struct intel_context *intel,
>  	  * a combined depth/stencil buffer. Discard the hiz buffer too.
>  	  */
>  	 intel->intelScreen->dri2_has_hiz = INTEL_DRI2_HAS_HIZ_FALSE;
> +	 if (intel->must_use_separate_stencil) {
> +	    assert(!"intel_context requires separate stencil, but the "
> +		    "DRIscreen does not support it");
> +	 }
>  
>  	 /* 1. Discard depth and stencil renderbuffers. */
>  	 _mesa_remove_renderbuffer(fb, BUFFER_DEPTH);

Much nicer!  I've hit some format == S8 assertion failures and gone
"What the heck?" many times before remembering "oh, wrong DDX
installed."  I like this.

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


More information about the mesa-dev mailing list