summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-11-06 15:51:06 +0000
committerBrian Paul <[email protected]>2001-11-06 15:51:06 +0000
commit07042d164bc49070f7cbf5e0211db376d724f2a4 (patch)
tree831b0905f2c52afe5a57df52f1213df87ac2c32e /src
parent0739d6f15808f4902fb82a155a767456d2b79298 (diff)
added missing GL_MAX_TEXTURE_LOD_BIAS_EXT query
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/config.h5
-rw-r--r--src/mesa/main/context.c3
-rw-r--r--src/mesa/main/get.c22
-rw-r--r--src/mesa/main/mtypes.h3
-rw-r--r--src/mesa/main/texstate.c5
5 files changed, 32 insertions, 6 deletions
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index fa65d611bd0..7d0b942cefb 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -1,4 +1,4 @@
-/* $Id: config.h,v 1.34 2001/07/16 15:54:23 brianp Exp $ */
+/* $Id: config.h,v 1.34.2.1 2001/11/06 15:51:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -134,6 +134,9 @@
/* GL_EXT_texture_filter_anisotropic */
#define MAX_TEXTURE_MAX_ANISOTROPY 16.0
+/* GL_EXT_texture_lod_bias */
+#define MAX_TEXTURE_LOD_BIAS 4.0
+
/*
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 690071fee92..76b3a6b1470 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.148 2001/10/18 08:04:57 joukj Exp $ */
+/* $Id: context.c,v 1.148.2.1 2001/11/06 15:51:06 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -738,6 +738,7 @@ init_attrib_groups( GLcontext *ctx )
ctx->Const.MaxCubeTextureLevels = MAX_CUBE_TEXTURE_LEVELS;
ctx->Const.MaxTextureUnits = MAX_TEXTURE_UNITS;
ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY;
+ ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS;
ctx->Const.MaxArrayLockSize = MAX_ARRAY_LOCK_SIZE;
ctx->Const.SubPixelBits = SUB_PIXEL_BITS;
ctx->Const.MinPointSize = MIN_POINT_SIZE;
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 9862986a8d5..950fe599da6 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1,4 +1,4 @@
-/* $Id: get.c,v 1.69.2.1 2001/10/25 23:21:11 brianp Exp $ */
+/* $Id: get.c,v 1.69.2.2 2001/11/06 15:51:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1258,6 +1258,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = INT_TO_BOOL(ctx->Array.FogCoord.Stride);
break;
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = FLOAT_TO_BOOL(ctx->Const.MaxTextureLodBias);
+ break;
+
/* GL_EXT_texture_filter_anisotropic */
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
@@ -2557,6 +2562,11 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Array.FogCoord.Stride;
break;
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = (GLdouble) ctx->Const.MaxTextureLodBias;
+ break;
+
/* GL_EXT_texture_filter_anisotropic */
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
@@ -3837,6 +3847,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Array.FogCoord.Stride;
break;
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = ctx->Const.MaxTextureLodBias;
+ break;
+
/* GL_EXT_texture_filter_anisotropic */
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
@@ -5159,6 +5174,11 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
}
break;
+ /* GL_EXT_texture_lod_bias */
+ case GL_MAX_TEXTURE_LOD_BIAS_EXT:
+ *params = (GLint) ctx->Const.MaxTextureLodBias;
+ break;
+
/* GL_EXT_texture_filter_anisotropic */
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
if (ctx->Extensions.EXT_texture_filter_anisotropic) {
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index c670e574132..fc253ef30d9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,4 +1,4 @@
-/* $Id: mtypes.h,v 1.51 2001/10/17 13:31:07 brianp Exp $ */
+/* $Id: mtypes.h,v 1.51.2.1 2001/11/06 15:51:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1165,6 +1165,7 @@ struct gl_constants {
GLint MaxCubeTextureLevels;
GLuint MaxTextureUnits;
GLfloat MaxTextureMaxAnisotropy; /* GL_EXT_texture_filter_anisotropic */
+ GLfloat MaxTextureLodBias; /* GL_EXT_texture_lod_bias */
GLuint MaxArrayLockSize;
GLint SubPixelBits;
GLfloat MinPointSize, MaxPointSize; /* aliased */
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index f2f02116066..53674b050b3 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.58 2001/10/17 13:31:07 brianp Exp $ */
+/* $Id: texstate.c,v 1.58.2.1 2001/11/06 15:51:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -413,7 +413,8 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
if (texUnit->LodBias == param[0])
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- texUnit->LodBias = param[0];
+ texUnit->LodBias = CLAMP(param[0], -ctx->Const.MaxTextureLodBias,
+ ctx->Const.MaxTextureLodBias);
break;
default:
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);