diff options
author | Brian Paul <[email protected]> | 2003-08-28 03:04:41 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-08-28 03:04:41 +0000 |
commit | 781fb93877ea3a6faeefcdb48d9b463da7d954a3 (patch) | |
tree | c933acef1652c7af93315b5a74cd735793e68740 /src/mesa/main | |
parent | a6ed6f48e6bf4ca5427d921cac863cf3b42f7efc (diff) |
Added OpenGL 1.4's per-texture LOD bias.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/extensions.c | 1 | ||||
-rw-r--r-- | src/mesa/main/get.c | 1 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 1 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 2 | ||||
-rw-r--r-- | src/mesa/main/texstate.c | 20 |
5 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 9122ff5a7aa..886311e0f1c 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -290,6 +290,7 @@ _mesa_enable_1_4_extensions(GLcontext *ctx) 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; } diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 92d6a1d3a12..29cc14636dd 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -6428,6 +6428,7 @@ _mesa_GetString( GLenum name ) 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 && diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 90fdd3b83c4..5497aac8380 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1073,6 +1073,7 @@ struct gl_texture_object { 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 */ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index ff0a0535f11..6edb7e65655 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -114,6 +114,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, 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; @@ -242,6 +243,7 @@ _mesa_copy_texture_object( struct gl_texture_object *dest, 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; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 8110772d3c8..2c1d155f52e 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1399,6 +1399,14 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) 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, @@ -1775,6 +1783,12 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) return; } break; + case GL_TEXTURE_LOD_BIAS: + if (ctx->Extensions.EXT_texture_lod_bias) { + *params = obj->LodBias; + break; + } + break; default: ; /* silence warnings */ } @@ -1801,6 +1815,12 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) 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; |