{
GET_CURRENT_CONTEXT(ctx);
static const char *caller = "glGetTextureSubImage";
- struct gl_texture_object *texObj = NULL;
-
- if (texture > 0)
- texObj = _mesa_lookup_texture(ctx, texture);
+ struct gl_texture_object *texObj =
+ _mesa_lookup_texture_err(ctx, texture, caller);
if (!texObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);
return;
}
static const char *caller = "glGetCompressedTextureImage";
struct gl_texture_object *texObj = NULL;
- if (texture > 0)
- texObj = _mesa_lookup_texture(ctx, texture);
-
+ texObj = _mesa_lookup_texture_err(ctx, texture, caller);
if (!texObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);
return;
}