<p dir="ltr"><br>
On May 4, 2015 4:25 AM, "Iago Toral Quiroga" <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> wrote:<br>
><br>
> Return MESA_FORMAT_NONE if no matching type was found. We have an<br>
> assertion here, but we should return something anyway to avoid<br>
> confusion with non-debug builds.<br>
> ---<br>
>  src/mesa/main/glformats.c | 1 +<br>
>  1 file changed, 1 insertion(+)<br>
><br>
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c<br>
> index 8ced579..fddd048 100644<br>
> --- a/src/mesa/main/glformats.c<br>
> +++ b/src/mesa/main/glformats.c<br>
> @@ -2752,4 +2752,5 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)<br>
>      * format in that case.<br>
>      */<br>
>     unreachable("Unsupported format");<br>
> +   return MESA_FORMAT_NONE;</p>
<p dir="ltr">If we want this to have well-defined results, this should not be an unreachable().  The semantics of unreachable allow the compiler to generate wrong code for the case where it does get reached.  We could switch it to an assert or we could just drop this patch. I'd be a fan of the latter.<br>
--Jason</p>
<p dir="ltr">>  }<br>
> --<br>
> 1.9.1<br>
><br>
</p>