summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2014-11-28 10:03:56 +0100
committerIago Toral Quiroga <[email protected]>2015-01-12 11:20:27 +0100
commit3473a84fb2c2cdab0bcecb43fbf519d9b3fc0142 (patch)
treed281dd826b2f19bb85779d3e9c880d6be3442c50 /src/mesa/main/teximage.c
parentb2b39ce2578870e87b892d603ad68b872c54d2ba (diff)
mesa: Fix incorrect assertion in init_teximage_fields_ms
_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 caught properly by the ASSERT in init_teximage_fields_ms until now. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index aad60f3f739..4fa7f0fcaf6 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1230,7 +1230,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;