<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 1, 2014 at 3:04 AM, Iago Toral Quiroga <span dir="ltr"><<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_BaseFormat is a GLenum (unsigned int) so testing if its value is<br>
greater than 0 to detect the cases where _mesa_base_tex_format<br>
returns -1 doesn't work.<br>
<br>
Fixing the assertion breaks the arb_texture_view-lifetime-format<br>
piglit test on nouveau, since that test calls<br>
_mesa_base_tex_format with GL_R16F with a context that does not<br>
have ARB_texture_float, so it returns -1 for the BaseFormat, which<br>
was not being catched properly by the ASSERT in init_teximage_fields_ms<br>
until now.<br></blockquote><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
src/mesa/main/teximage.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c<br>
index e238863..c9658c1 100644<br>
--- a/src/mesa/main/teximage.c<br>
+++ b/src/mesa/main/teximage.c<br>
@@ -1313,7 +1313,7 @@ init_teximage_fields_ms(struct gl_context *ctx,<br>
<br>
target = img->TexObject->Target;<br>
img->_BaseFormat = _mesa_base_tex_format( ctx, internalFormat );<br>
- ASSERT(img->_BaseFormat > 0);<br>
+ ASSERT(img->_BaseFormat != -1);<br>
img->InternalFormat = internalFormat;<br>
img->Border = border;<br>
img->Width = width;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>