/* Texture Parameters */
/**********************************************************************/
+/**
+ * Check if a coordinate wrap mode is supported for the texture target.
+ * \return GL_TRUE if legal, GL_FALSE otherwise
+ */
static GLboolean
-_mesa_validate_texture_wrap_mode(GLcontext * ctx,
- GLenum target, GLenum eparam)
+validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap)
{
const struct gl_extensions * const e = & ctx->Extensions;
- if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE ||
- (eparam == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) {
+ if (wrap == GL_CLAMP || wrap == GL_CLAMP_TO_EDGE ||
+ (wrap == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) {
/* any texture target */
return GL_TRUE;
}
else if (target != GL_TEXTURE_RECTANGLE_NV &&
- (eparam == GL_REPEAT ||
- (eparam == GL_MIRRORED_REPEAT &&
+ (wrap == GL_REPEAT ||
+ (wrap == GL_MIRRORED_REPEAT &&
e->ARB_texture_mirrored_repeat) ||
- (eparam == GL_MIRROR_CLAMP_EXT &&
+ (wrap == GL_MIRROR_CLAMP_EXT &&
(e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) ||
- (eparam == GL_MIRROR_CLAMP_TO_EDGE_EXT &&
+ (wrap == GL_MIRROR_CLAMP_TO_EDGE_EXT &&
(e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) ||
- (eparam == GL_MIRROR_CLAMP_TO_BORDER_EXT &&
+ (wrap == GL_MIRROR_CLAMP_TO_BORDER_EXT &&
(e->EXT_texture_mirror_clamp)))) {
/* non-rectangle texture */
return GL_TRUE;
case GL_TEXTURE_WRAP_S:
if (texObj->WrapS == eparam)
return;
- if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
+ if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->WrapS = eparam;
}
case GL_TEXTURE_WRAP_T:
if (texObj->WrapT == eparam)
return;
- if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
+ if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->WrapT = eparam;
}
case GL_TEXTURE_WRAP_R:
if (texObj->WrapR == eparam)
return;
- if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
+ if (validate_texture_wrap_mode(ctx, texObj->Target, eparam)) {
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->WrapR = eparam;
}