const GLvoid *data, enum tex_mode mode,
const char *caller)
{
- struct gl_texture_object *texObj;
+ struct gl_texture_object *texObj = NULL;
struct gl_texture_image *texImage;
bool no_error = false;
GET_CURRENT_CONTEXT(ctx);
case TEX_MODE_CURRENT_ERROR:
default:
assert(textureOrIndex == 0);
- texObj = _mesa_get_current_tex_object(ctx, target);
break;
}
- if (!texObj)
- return;
-
-
if (!no_error &&
compressed_subtexture_target_check(ctx, target, dim, format,
mode == TEX_MODE_DSA_ERROR,
return;
}
- if (!no_error && !texObj)
+ if (mode == TEX_MODE_CURRENT_NO_ERROR ||
+ mode == TEX_MODE_CURRENT_ERROR) {
+ texObj = _mesa_get_current_tex_object(ctx, target);
+ }
+
+ if (!texObj)
return;
if (!no_error &&