main: Checking for cube completeness in GetCompressedTextureImage.

v2: Review from Anuj Phogat
   - Remove redundant copies of the cube map block comment
   - Replace redundant "if (!texImage) return;" statements with
     assert(texImage)

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
This commit is contained in:
Laura Ekstrand
2015-01-06 14:05:41 -08:00
parent 4080c330fa
commit ff011340a4
+10 -1
View File
@@ -1303,7 +1303,16 @@ _mesa_GetCompressedTextureImage(GLuint texture, GLint level,
/* Must handle special case GL_TEXTURE_CUBE_MAP. */
if (texObj->Target == GL_TEXTURE_CUBE_MAP) {
assert(texObj->NumLayers >= 6);
/* Make sure the texture object is a proper cube.
* (See texturesubimage in teximage.c for details on why this check is
* performed.)
*/
if (!_mesa_cube_level_complete(texObj, level)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetCompressedTextureImage(cube map incomplete)");
return;
}
/* Copy each face. */
for (i = 0; i < 6; ++i) {