/* EXT/ARB direct_state_access variants don't call _get_texture_image
* with a NULL texObj */
bool is_dsa = texObj != NULL;
- if (!legal_getteximage_target(ctx, target, is_dsa)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "%s", caller);
- return;
- }
if (!is_dsa) {
texObj = _mesa_get_current_tex_object(ctx, target);
GET_CURRENT_CONTEXT(ctx);
static const char *caller = "glGetnTexImageARB";
+ if (!legal_getteximage_target(ctx, target, false)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s", caller);
+ return;
+ }
+
_get_texture_image(ctx, NULL, target, level, format, type,
bufSize, pixels, caller);
}
GET_CURRENT_CONTEXT(ctx);
static const char *caller = "glGetTexImage";
+ if (!legal_getteximage_target(ctx, target, false)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s", caller);
+ return;
+ }
+
_get_texture_image(ctx, NULL, target, level, format, type,
INT_MAX, pixels, caller);
}
return;
}
+ if (!legal_getteximage_target(ctx, texObj->Target, true)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
+ return;
+ }
+
_get_texture_image(ctx, texObj, texObj->Target, level, format, type,
bufSize, pixels, caller);
}
return;
}
+ if (!legal_getteximage_target(ctx, target, true)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s", caller);
+ return;
+ }
+
_get_texture_image(ctx, texObj, target, level, format, type,
INT_MAX, pixels, caller);
}