if (texUnit->LodBias == param[0])
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->LodBias = CLAMP(param[0], -ctx->Const.MaxTextureLodBias,
- ctx->Const.MaxTextureLodBias);
+ texUnit->LodBias = param[0];
}
else {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
case GL_TEXTURE_LOD_BIAS:
/* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias*/
if (ctx->Extensions.EXT_texture_lod_bias) {
- texObj->LodBias = CLAMP(params[0],
- -ctx->Const.MaxTextureLodBias,
- ctx->Const.MaxTextureLodBias);
+ if (texObj->LodBias != params[0]) {
+ FLUSH_VERTICES(ctx, _NEW_TEXTURE);
+ texObj->LodBias = params[0];
+ }
}
break;
if (span->arrayMask & SPAN_LAMBDA) {
if (texUnit->LodBias + curObj->LodBias != 0.0F) {
/* apply LOD bias, but don't clamp yet */
+ const GLfloat bias = CLAMP(texUnit->LodBias + curObj->LodBias,
+ -ctx->Const.MaxTextureLodBias,
+ ctx->Const.MaxTextureLodBias);
GLuint i;
for (i = 0; i < span->end; i++) {
- lambda[i] += (texUnit->LodBias + curObj->LodBias);
+ lambda[i] += bias;
}
}