[Mesa-dev] [PATCH v2 06/23] mesa: Fix incorrect assertion in init_teximage_fields_ms

Jason Ekstrand jason at jlekstrand.net
Mon Dec 1 10:18:08 PST 2014


On Mon, Dec 1, 2014 at 3:04 AM, Iago Toral Quiroga <itoral at igalia.com>
wrote:

> _BaseFormat is a GLenum (unsigned int) so testing if its value is
> greater than 0 to detect the cases where _mesa_base_tex_format
> returns -1 doesn't work.
>
> Fixing the assertion breaks the arb_texture_view-lifetime-format
> piglit test on nouveau, since that test calls
> _mesa_base_tex_format with GL_R16F with a context that does not
> have ARB_texture_float, so it returns -1 for the BaseFormat, which
> was not being catched properly by the ASSERT in init_teximage_fields_ms
> until now.
>

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

---
>  src/mesa/main/teximage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index e238863..c9658c1 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -1313,7 +1313,7 @@ init_teximage_fields_ms(struct gl_context *ctx,
>
>     target = img->TexObject->Target;
>     img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat );
> -   ASSERT(img->_BaseFormat > 0);
> +   ASSERT(img->_BaseFormat != -1);
>     img->InternalFormat = internalFormat;
>     img->Border = border;
>     img->Width = width;
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141201/67891a60/attachment.html>


More information about the mesa-dev mailing list