FLUSH_VERTICES(ctx, 0);
- if (!_mesa_is_valid_generate_texture_mipmap_target(ctx, target)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGenerate%sMipmap(target=%s)",
- suffix, _mesa_enum_to_string(target));
- return;
- }
-
if (texObj->BaseLevel >= texObj->MaxLevel) {
/* nothing to do */
return;
struct gl_texture_object *texObj;
GET_CURRENT_CONTEXT(ctx);
+ if (!_mesa_is_valid_generate_texture_mipmap_target(ctx, target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmap(target=%s)",
+ _mesa_enum_to_string(target));
+ return;
+ }
+
texObj = _mesa_get_current_tex_object(ctx, target);
if (!texObj)
return;
if (!texObj)
return;
+ if (!_mesa_is_valid_generate_texture_mipmap_target(ctx, texObj->Target)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateTextureMipmap(target=%s)",
+ _mesa_enum_to_string(texObj->Target));
+ return;
+ }
+
_mesa_generate_texture_mipmap(ctx, texObj, texObj->Target, true);
}