diff options
author | Brian Paul <[email protected]> | 2012-03-20 07:46:47 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-03-20 09:43:10 -0600 |
commit | 75f82b5d580296a27ed026bc257763bfe24cfa60 (patch) | |
tree | 5a871bc534dcb0421f3fb2cf7074c806075d946f /src | |
parent | 2cbccfdcb09322f5711cff995f9a2953af355d35 (diff) |
mesa: only test cube face widths in _mesa_test_texobj_completeness()
As Eric pointed out, we know the cube faces are square at this point
so we only need to test the texture widths for consistency.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/texobj.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index d641e40ad72..cfaac64bfd6 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -540,14 +540,17 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx, } if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) { - /* make sure that all six cube map level 0 images are the same size */ - const GLuint w = baseImage->Width2; - const GLuint h = baseImage->Height2; + /* Make sure that all six cube map level 0 images are the same size. + * Note: we know that the image's width==height (we enforce that + * at glTexImage time) so we only need to test the width here. + */ GLuint face; + assert(baseImage->Width2 == baseImage->Height); for (face = 1; face < 6; face++) { + assert(t->Image[face][baseLevel]->Width2 == + t->Image[face][baseLevel]->Height2); if (t->Image[face][baseLevel] == NULL || - t->Image[face][baseLevel]->Width2 != w || - t->Image[face][baseLevel]->Height2 != h) { + t->Image[face][baseLevel]->Width2 != baseImage->Width2) { incomplete(t, BASE, "Cube face missing or mismatched size"); return; } |