summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/teximage.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index f90765f40fa..4174294c79b 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2979,17 +2979,18 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
internalFormat = override_internal_format(internalFormat, width, height);
+ if (!no_error &&
+ /* target error checking */
+ !legal_teximage_target(ctx, dims, target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s%uD(target=%s)",
+ func, dims, _mesa_enum_to_string(target));
+ return;
+ }
+
if (!texObj)
texObj = _mesa_get_current_tex_object(ctx, target);
if (!no_error) {
- /* target error checking */
- if (!legal_teximage_target(ctx, dims, target)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "%s%uD(target=%s)",
- func, dims, _mesa_enum_to_string(target));
- return;
- }
-
/* general error checking */
if (compressed) {
if (compressed_texture_error_check(ctx, dims, target, texObj,