ctx->Extensions.EXT_point_parameters = GL_TRUE;
ctx->Extensions.EXT_secondary_color = GL_TRUE;
ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
+ ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
}
ctx->Extensions.EXT_point_parameters && /*aka ARB*/
ctx->Extensions.EXT_secondary_color &&
ctx->Extensions.EXT_stencil_wrap &&
+ ctx->Extensions.EXT_texture_lod_bias &&
ctx->Extensions.SGIS_generate_mipmap) {
if (ctx->Extensions.ARB_occlusion_query &&
ctx->Extensions.ARB_point_sprite &&
GLenum MagFilter; /**< magnification filter */
GLfloat MinLod; /**< min lambda, OpenGL 1.2 */
GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */
+ GLfloat LodBias; /**< OpenGL 1.4 */
GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */
GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */
GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
obj->MagFilter = GL_LINEAR;
obj->MinLod = -1000.0;
obj->MaxLod = 1000.0;
+ obj->LodBias = 0.0;
obj->BaseLevel = 0;
obj->MaxLevel = 1000;
obj->MaxAnisotropy = 1.0;
dest->MagFilter = src->MagFilter;
dest->MinLod = src->MinLod;
dest->MaxLod = src->MaxLod;
+ dest->LodBias = src->LodBias;
dest->BaseLevel = src->BaseLevel;
dest->MaxLevel = src->MaxLevel;
dest->MaxAnisotropy = src->MaxAnisotropy;
return;
}
break;
+ 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);
+ }
+ break;
default:
_mesa_error(ctx, GL_INVALID_ENUM,
return;
}
break;
+ case GL_TEXTURE_LOD_BIAS:
+ if (ctx->Extensions.EXT_texture_lod_bias) {
+ *params = obj->LodBias;
+ break;
+ }
+ break;
default:
; /* silence warnings */
}
switch (pname) {
case GL_TEXTURE_MAG_FILTER:
*params = (GLint) obj->MagFilter;
+ case GL_TEXTURE_LOD_BIAS:
+ if (ctx->Extensions.EXT_texture_lod_bias) {
+ *params = (GLint) obj->LodBias;
+ break;
+ }
+ break;
return;
case GL_TEXTURE_MIN_FILTER:
*params = (GLint) obj->MinFilter;
/* adjust texture lod (lambda) */
if (span->arrayMask & SPAN_LAMBDA) {
- if (texUnit->LodBias != 0.0F) {
+ if (texUnit->LodBias + curObj->LodBias != 0.0F) {
/* apply LOD bias, but don't clamp yet */
GLuint i;
for (i = 0; i < span->end; i++) {
- lambda[i] += texUnit->LodBias;
+ lambda[i] += (texUnit->LodBias + curObj->LodBias);
}
}