summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-09-15 10:30:20 -0600
committerBrian Paul <[email protected]>2012-09-17 19:49:26 -0600
commit7dc76e94246a14d995d2e9a4c8dc8591c4085849 (patch)
tree04af17397f3721b1bc3b9fd5a716b1e80cd0e858 /src
parentff24ed09fae56d1bfe844cb71a0aad5e9908cb55 (diff)
mesa: move/fix levels check for glTexStorage()
Fix copy&paste error and move min levels check closer to max levels check. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/texstorage.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 0a4cafe450a..ca02ef3017d 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -268,13 +268,6 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
return GL_TRUE;
}
- /* levels check */
- if (levels < 1 || height < 1 || depth < 1) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glTexStorage%uD(levels < 1)",
- dims);
- return GL_TRUE;
- }
-
/* target check */
if (!legal_texobj_target(ctx, dims, target)) {
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -283,7 +276,14 @@ tex_storage_error_check(struct gl_context *ctx, GLuint dims, GLenum target,
return GL_TRUE;
}
- /* check levels against maximum */
+ /* levels check */
+ if (levels < 1) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glTexStorage%uD(levels < 1)",
+ dims);
+ return GL_TRUE;
+ }
+
+ /* check levels against maximum (note different error than above) */
if (levels > _mesa_max_texture_levels(ctx, target)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glTexStorage%uD(levels too large)", dims);