summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstorage.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2012-11-11 15:25:55 +0100
committerMarek Olšák <maraeo@gmail.com>2012-11-12 21:37:30 +0100
commit985f2aec4a2ca74f6612f34ce0887eafcc163e08 (patch)
tree989225676872526eb4d35cb726a9485579c68de4 /src/mesa/main/texstorage.c
parent12a4fd7e45c8a410c3904f3153b912f04ca8eb10 (diff)
downloadexternal_mesa3d-985f2aec4a2ca74f6612f34ce0887eafcc163e08.zip
external_mesa3d-985f2aec4a2ca74f6612f34ce0887eafcc163e08.tar.gz
external_mesa3d-985f2aec4a2ca74f6612f34ce0887eafcc163e08.tar.bz2
mesa: fix error checking of TexStorage(levels) for array and rect textures
NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/main/texstorage.c')
-rw-r--r--src/mesa/main/texstorage.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 9e0b543..00f19ba 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -214,7 +214,6 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
GLsizei width, GLsizei height, GLsizei depth)
{
struct gl_texture_object *texObj;
- GLuint maxDim;
GLboolean legalFormat;
/* check internal format - note that only sized formats are allowed */
@@ -294,8 +293,7 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
}
/* check levels against width/height/depth */
- maxDim = MAX3(width, height, depth);
- if (levels > (GLint) _mesa_logbase2(maxDim) + 1) {
+ if (levels > _mesa_get_tex_max_num_levels(target, width, height, depth)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTexStorage%uD(too many levels for max texture dimension)",
dims);