-/* $Id: texstate.c,v 1.60 2001/12/04 23:44:56 brianp Exp $ */
+/* $Id: texstate.c,v 1.61 2001/12/13 16:02:11 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
|| eparam==GL_LINEAR_MIPMAP_NEAREST
|| eparam==GL_NEAREST_MIPMAP_LINEAR
|| eparam==GL_LINEAR_MIPMAP_LINEAR) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->MinFilter = eparam;
}
else {
return;
if (eparam==GL_NEAREST || eparam==GL_LINEAR) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->MagFilter = eparam;
}
else {
ctx->Extensions.ARB_texture_border_clamp) ||
(eparam == GL_MIRRORED_REPEAT_ARB &&
ctx->Extensions.ARB_texture_mirrored_repeat)) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->WrapS = eparam;
}
else {
ctx->Extensions.ARB_texture_border_clamp) ||
(eparam == GL_MIRRORED_REPEAT_ARB &&
ctx->Extensions.ARB_texture_mirrored_repeat)) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->WrapT = eparam;
}
else {
ctx->Extensions.ARB_texture_border_clamp) ||
(eparam == GL_MIRRORED_REPEAT_ARB &&
ctx->Extensions.ARB_texture_mirrored_repeat)) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->WrapR = eparam;
}
else {
#if 0 /* someday */
case GL_TEXTUER_BORDER_VALUES_NV:
/* don't clamp */
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
COPY_4V(texObj->BorderValues, params);
UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[0], params[0]);
UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[1], params[1]);
#endif
case GL_TEXTURE_BORDER_COLOR:
/* clamp */
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->BorderValues[0] = CLAMP(params[0], 0.0F, 1.0F);
texObj->BorderValues[1] = CLAMP(params[1], 0.0F, 1.0F);
texObj->BorderValues[2] = CLAMP(params[2], 0.0F, 1.0F);
UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[3], texObj->BorderValues[3]);
break;
case GL_TEXTURE_MIN_LOD:
+ if (texObj->MinLod == params[0])
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->MinLod = params[0];
break;
case GL_TEXTURE_MAX_LOD:
+ if (texObj->MaxLod == params[0])
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->MaxLod = params[0];
break;
case GL_TEXTURE_BASE_LEVEL:
_mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
return;
}
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->BaseLevel = (GLint) params[0];
break;
case GL_TEXTURE_MAX_LEVEL:
_mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
return;
}
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->MaxLevel = (GLint) params[0];
break;
case GL_TEXTURE_PRIORITY:
/* (keithh@netcomuk.co.uk) */
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->Priority = CLAMP( params[0], 0.0F, 1.0F );
break;
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
_mesa_error(ctx, GL_INVALID_VALUE, "glTexParameter(param)" );
return;
}
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->MaxAnisotropy = params[0];
}
else {
break;
case GL_TEXTURE_COMPARE_SGIX:
if (ctx->Extensions.SGIX_shadow) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE;
}
else {
GLenum op = (GLenum) params[0];
if (op == GL_TEXTURE_LEQUAL_R_SGIX ||
op == GL_TEXTURE_GEQUAL_R_SGIX) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->CompareOperator = op;
}
else {
break;
case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */
if (ctx->Extensions.SGIX_shadow_ambient) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
UNCLAMPED_FLOAT_TO_CHAN(texObj->ShadowAmbient, params[0]);
}
else {
if (ctx->Extensions.ARB_shadow) {
const GLenum mode = (GLenum) params[0];
if (mode == GL_LUMINANCE || mode == GL_COMPARE_R_TO_TEXTURE_ARB) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->CompareMode = params[0];
}
else {
if (ctx->Extensions.ARB_shadow) {
const GLenum func = (GLenum) params[0];
if (func == GL_LEQUAL || func == GL_GEQUAL) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->CompareFunc = params[0];
}
else {
const GLenum result = (GLenum) params[0];
if (result == GL_LUMINANCE || result == GL_INTENSITY
|| result == GL_ALPHA) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texObj->CompareResult = params[0];
}
else {
return;
}
- ctx->NewState |= _NEW_TEXTURE;
texObj->Complete = GL_FALSE;
if (ctx->Driver.TexParameter) {