_mesa_enum_to_string(pname));
}
+static bool
+valid_tex_level_parameteriv_target(struct gl_context *ctx, GLenum target,
+ bool dsa)
+{
+ const char *suffix = dsa ? "ture" : "";
+ if (!legal_get_tex_level_parameter_target(ctx, target, dsa)) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetTex%sLevelParameter[if]v(target=%s)", suffix,
+ _mesa_enum_to_string(target));
+ return false;
+ }
+ return true;
+}
/**
* This isn't exposed to the rest of the driver because it is a part of the
return;
}
- if (!legal_get_tex_level_parameter_target(ctx, target, dsa)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glGetTex%sLevelParameter[if]v(target=%s)", suffix,
- _mesa_enum_to_string(target));
- return;
- }
-
maxLevels = _mesa_max_texture_levels(ctx, target);
assert(maxLevels != 0);
GLint iparam;
GET_CURRENT_CONTEXT(ctx);
+ if (!valid_tex_level_parameteriv_target(ctx, target, false))
+ return;
+
texObj = _mesa_get_current_tex_object(ctx, target);
if (!texObj)
return;
struct gl_texture_object *texObj;
GET_CURRENT_CONTEXT(ctx);
+ if (!valid_tex_level_parameteriv_target(ctx, target, false))
+ return;
+
texObj = _mesa_get_current_tex_object(ctx, target);
if (!texObj)
return;
if (!texObj)
return;
+ if (!valid_tex_level_parameteriv_target(ctx, texObj->Target, true))
+ return;
+
get_tex_level_parameteriv(ctx, texObj, texObj->Target, level,
pname, &iparam, true);
if (!texObj)
return;
+ if (!valid_tex_level_parameteriv_target(ctx, texObj->Target, true))
+ return;
+
get_tex_level_parameteriv(ctx, texObj, texObj->Target, level,
pname, params, true);
}