diff options
author | Brian Paul <[email protected]> | 2002-10-04 19:10:06 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-10-04 19:10:06 +0000 |
commit | fc80ad6e62fb2b53d53756593099330477a44c52 (patch) | |
tree | 0b47f3ee84d613dfa2264d6f23e5c2a60cecc9ba /src/mesa/main | |
parent | f782b8189e718974a40d72ac4f6b8d213ca99e1e (diff) |
Changed a number of context fields from GLchan to GLfloat (such as ClearColor).
Also changed parameter types for some driver functions (like ctx->Driver.Clear-
Color). Updated all the device drivers.
Someday, we want to support 8, 16 and 32-bit channels dynamically at runtime.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/attrib.c | 15 | ||||
-rw-r--r-- | src/mesa/main/blend.c | 14 | ||||
-rw-r--r-- | src/mesa/main/buffers.c | 16 | ||||
-rw-r--r-- | src/mesa/main/dd.h | 10 | ||||
-rw-r--r-- | src/mesa/main/get.c | 26 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 29 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 4 | ||||
-rw-r--r-- | src/mesa/main/texstate.c | 73 |
8 files changed, 61 insertions, 126 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 2ebaaf73414..51787b75052 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,4 +1,4 @@ -/* $Id: attrib.c,v 1.71 2002/09/06 02:56:08 brianp Exp $ */ +/* $Id: attrib.c,v 1.72 2002/10/04 19:10:06 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -739,7 +739,7 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib) } if (ctx->Extensions.SGIX_shadow_ambient) { _mesa_TexParameterf(target, GL_SHADOW_AMBIENT_SGIX, - CHAN_TO_FLOAT(obj->ShadowAmbient)); + obj->ShadowAmbient); } } @@ -809,10 +809,10 @@ _mesa_PopAttrib(void) const struct gl_colorbuffer_attrib *color; color = (const struct gl_colorbuffer_attrib *) attr->data; _mesa_ClearIndex((GLfloat) color->ClearIndex); - _mesa_ClearColor(CHAN_TO_FLOAT(color->ClearColor[0]), - CHAN_TO_FLOAT(color->ClearColor[1]), - CHAN_TO_FLOAT(color->ClearColor[2]), - CHAN_TO_FLOAT(color->ClearColor[3])); + _mesa_ClearColor(color->ClearColor[0], + color->ClearColor[1], + color->ClearColor[2], + color->ClearColor[3]); _mesa_IndexMask(color->IndexMask); _mesa_ColorMask((GLboolean) (color->ColorMask[0] != 0), (GLboolean) (color->ColorMask[1] != 0), @@ -820,8 +820,7 @@ _mesa_PopAttrib(void) (GLboolean) (color->ColorMask[3] != 0)); _mesa_DrawBuffer(color->DrawBuffer); _mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled); - _mesa_AlphaFunc(color->AlphaFunc, - CHAN_TO_FLOAT(color->AlphaRef)); + _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef); _mesa_set_enable(ctx, GL_BLEND, color->BlendEnabled); _mesa_BlendFuncSeparateEXT(color->BlendSrcRGB, color->BlendDstRGB, diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 97b11872c42..98385e0a70a 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -1,4 +1,4 @@ -/* $Id: blend.c,v 1.36 2002/06/15 02:38:15 brianp Exp $ */ +/* $Id: blend.c,v 1.37 2002/10/04 19:10:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -346,7 +346,6 @@ void _mesa_AlphaFunc( GLenum func, GLclampf ref ) { GET_CURRENT_CONTEXT(ctx); - GLchan cref; ASSERT_OUTSIDE_BEGIN_END(ctx); switch (func) { @@ -358,18 +357,17 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref ) case GL_NOTEQUAL: case GL_GEQUAL: case GL_ALWAYS: - /* convert float alpha ref to GLchan type */ - UNCLAMPED_FLOAT_TO_CHAN(cref, ref); + ref = CLAMP(ref, 0.0F, 1.0F); - if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRef == cref) - return; + if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRef == ref) + return; /* no change */ FLUSH_VERTICES(ctx, _NEW_COLOR); ctx->Color.AlphaFunc = func; - ctx->Color.AlphaRef = cref; + ctx->Color.AlphaRef = ref; if (ctx->Driver.AlphaFunc) - ctx->Driver.AlphaFunc(ctx, func, cref); + ctx->Driver.AlphaFunc(ctx, func, ref); return; default: diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 04a490ada5d..20a1c2ee22f 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -1,4 +1,4 @@ -/* $Id: buffers.c,v 1.37 2002/07/09 01:22:50 brianp Exp $ */ +/* $Id: buffers.c,v 1.38 2002/10/04 19:10:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -67,20 +67,20 @@ _mesa_ClearIndex( GLfloat c ) void _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) { - GLchan tmp[4]; + GLfloat tmp[4]; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - UNCLAMPED_FLOAT_TO_CHAN(tmp[0], red); - UNCLAMPED_FLOAT_TO_CHAN(tmp[1], green); - UNCLAMPED_FLOAT_TO_CHAN(tmp[2], blue); - UNCLAMPED_FLOAT_TO_CHAN(tmp[3], alpha); + tmp[0] = CLAMP(red, 0.0F, 1.0F); + tmp[1] = CLAMP(green, 0.0F, 1.0F); + tmp[2] = CLAMP(blue, 0.0F, 1.0F); + tmp[3] = CLAMP(alpha, 0.0F, 1.0F); if (TEST_EQ_4V(tmp, ctx->Color.ClearColor)) - return; + return; /* no change */ FLUSH_VERTICES(ctx, _NEW_COLOR); - COPY_CHAN4(ctx->Color.ClearColor, tmp); + COPY_4V(ctx->Color.ClearColor, tmp); if (ctx->Visual.rgbMode && ctx->Driver.ClearColor) { /* it's OK to call glClearColor in CI mode but it should be a NOP */ diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 8f40846975e..fc02a15620b 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1,4 +1,4 @@ -/* $Id: dd.h,v 1.72 2002/09/27 02:45:37 brianp Exp $ */ +/* $Id: dd.h,v 1.73 2002/10/04 19:10:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -409,22 +409,14 @@ struct dd_function_table { *** They're ALSO called by the gl_PopAttrib() function!!! *** May add more functions like these to the device driver in the future. ***/ -#if 1 - void (*AlphaFunc)(GLcontext *ctx, GLenum func, GLchan ref); -#else void (*AlphaFunc)(GLcontext *ctx, GLenum func, GLfloat ref); -#endif void (*BlendColor)(GLcontext *ctx, const GLfloat color[4]); void (*BlendEquation)(GLcontext *ctx, GLenum mode); void (*BlendFunc)(GLcontext *ctx, GLenum sfactor, GLenum dfactor); void (*BlendFuncSeparate)(GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorA, GLenum dfactorA); -#if 1 - void (*ClearColor)(GLcontext *ctx, const GLchan color[4]); -#else void (*ClearColor)(GLcontext *ctx, const GLfloat color[4]); -#endif void (*ClearDepth)(GLcontext *ctx, GLclampd d); void (*ClearIndex)(GLcontext *ctx, GLuint index); void (*ClearStencil)(GLcontext *ctx, GLint s); diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 4eee2c9fa76..a952a824b01 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,4 +1,4 @@ -/* $Id: get.c,v 1.92 2002/09/27 02:45:37 brianp Exp $ */ +/* $Id: get.c,v 1.93 2002/10/04 19:10:08 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -173,7 +173,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = ENUM_TO_BOOL(ctx->Color.AlphaFunc); break; case GL_ALPHA_TEST_REF: - *params = FLOAT_TO_BOOL((GLfloat) ctx->Color.AlphaRef / CHAN_MAXF); + *params = ctx->Color.AlphaRef ? GL_TRUE : GL_FALSE; break; case GL_ATTRIB_STACK_DEPTH: *params = INT_TO_BOOL(ctx->AttribStackDepth); @@ -1537,7 +1537,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = ENUM_TO_DOUBLE(ctx->Color.AlphaFunc); break; case GL_ALPHA_TEST_REF: - *params = (GLdouble) ctx->Color.AlphaRef / CHAN_MAXF; + *params = (GLdouble) ctx->Color.AlphaRef; break; case GL_ATTRIB_STACK_DEPTH: *params = (GLdouble ) (ctx->AttribStackDepth); @@ -1602,10 +1602,10 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = 0.0; break; case GL_COLOR_CLEAR_VALUE: - params[0] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[0]); - params[1] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[1]); - params[2] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[2]); - params[3] = (GLdouble) CHAN_TO_FLOAT(ctx->Color.ClearColor[3]); + params[0] = (GLdouble) ctx->Color.ClearColor[0]; + params[1] = (GLdouble) ctx->Color.ClearColor[1]; + params[2] = (GLdouble) ctx->Color.ClearColor[2]; + params[3] = (GLdouble) ctx->Color.ClearColor[3]; break; case GL_COLOR_MATERIAL: *params = (GLdouble) ctx->Light.ColorMaterialEnabled; @@ -2898,7 +2898,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = ENUM_TO_FLOAT(ctx->Color.AlphaFunc); break; case GL_ALPHA_TEST_REF: - *params = (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF; + *params = (GLfloat) ctx->Color.AlphaRef; break; case GL_ATTRIB_STACK_DEPTH: *params = (GLfloat) (ctx->AttribStackDepth); @@ -2963,10 +2963,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = 0.0; break; case GL_COLOR_CLEAR_VALUE: - params[0] = CHAN_TO_FLOAT(ctx->Color.ClearColor[0]); - params[1] = CHAN_TO_FLOAT(ctx->Color.ClearColor[1]); - params[2] = CHAN_TO_FLOAT(ctx->Color.ClearColor[2]); - params[3] = CHAN_TO_FLOAT(ctx->Color.ClearColor[3]); + params[0] = ctx->Color.ClearColor[0]; + params[1] = ctx->Color.ClearColor[1]; + params[2] = ctx->Color.ClearColor[2]; + params[3] = ctx->Color.ClearColor[3]; break; case GL_COLOR_MATERIAL: *params = (GLfloat) ctx->Light.ColorMaterialEnabled; @@ -4233,7 +4233,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Color.AlphaEnabled; break; case GL_ALPHA_TEST_REF: - *params = FLOAT_TO_INT( (GLfloat) ctx->Color.AlphaRef / CHAN_MAXF ); + *params = FLOAT_TO_INT(ctx->Color.AlphaRef); break; case GL_ALPHA_TEST_FUNC: *params = (GLint) ctx->Color.AlphaFunc; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 83a63bfa118..e345c30a4c3 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,4 +1,4 @@ -/* $Id: mtypes.h,v 1.92 2002/10/02 23:24:04 brianp Exp $ */ +/* $Id: mtypes.h,v 1.93 2002/10/04 19:10:08 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -311,11 +311,7 @@ struct gl_accum_attrib { struct gl_colorbuffer_attrib { GLuint ClearIndex; /* Index to use for glClear */ -#if 1 - GLchan ClearColor[4]; /* Color to use for glClear */ -#else GLclampf ClearColor[4]; /* Color to use for glClear */ -#endif GLuint IndexMask; /* Color index write mask */ GLubyte ColorMask[4]; /* Each flag is 0xff or 0x0 */ @@ -327,11 +323,7 @@ struct gl_colorbuffer_attrib { /* alpha testing */ GLboolean AlphaEnabled; /* Alpha test enabled flag */ GLenum AlphaFunc; /* Alpha test function */ -#if 1 - GLchan AlphaRef; /* Alpha ref value as GLchan */ -#else GLclampf AlphaRef; -#endif /* blending */ GLboolean BlendEnabled; /* Blending enabled flag */ @@ -870,11 +862,8 @@ struct gl_texture_object { GLuint Name; /* an unsigned integer */ GLenum Target; /* GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */ GLfloat Priority; /* in [0,1] */ - GLfloat BorderValues[4]; /* unclamped */ -#if 1 - /* omit someday */ - GLchan BorderColor[4]; /* clamped, as GLchan */ -#endif + GLfloat BorderColor[4]; /* unclamped */ + GLchan _BorderChan[4]; /* clamped, as GLchan */ GLenum WrapS; /* Wrap modes are: GL_CLAMP, REPEAT */ GLenum WrapT; /* GL_CLAMP_TO_EDGE, and */ GLenum WrapR; /* GL_CLAMP_TO_BORDER_ARB */ @@ -887,11 +876,7 @@ struct gl_texture_object { GLfloat MaxAnisotropy; /* GL_EXT_texture_filter_anisotropic */ GLboolean CompareFlag; /* GL_SGIX_shadow */ GLenum CompareOperator; /* GL_SGIX_shadow */ -#if 1 - GLchan ShadowAmbient; /* GL_SGIX/ARB_shadow_ambient */ -#else GLfloat ShadowAmbient; -#endif GLenum CompareMode; /* GL_ARB_shadow */ GLenum CompareFunc; /* GL_ARB_shadow */ GLenum DepthMode; /* GL_ARB_depth_texture */ @@ -1329,17 +1314,11 @@ struct gl_frame_buffer { GLaccum *Accum; /* array [4*Width*Height] of GLaccum values */ /* Software alpha planes */ -#if 1 - GLchan *FrontLeftAlpha; /* array [Width*Height] of GLubyte */ - GLchan *BackLeftAlpha; /* array [Width*Height] of GLubyte */ - GLchan *FrontRightAlpha; /* array [Width*Height] of GLubyte */ - GLchan *BackRightAlpha; /* array [Width*Height] of GLubyte */ -#else GLvoid *FrontLeftAlpha; /* array [Width*Height] of GLubyte */ GLvoid *BackLeftAlpha; /* array [Width*Height] of GLubyte */ GLvoid *FrontRightAlpha; /* array [Width*Height] of GLubyte */ GLvoid *BackRightAlpha; /* array [Width*Height] of GLubyte */ -#endif + /* Drawing bounds: intersection of window size and scissor box */ GLint _Xmin, _Ymin; /* inclusive */ GLint _Xmax, _Ymax; /* exclusive */ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 909492cd499..c27d7a6a5f0 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,4 +1,4 @@ -/* $Id: texobj.c,v 1.57 2002/06/29 19:48:16 brianp Exp $ */ +/* $Id: texobj.c,v 1.58 2002/10/04 19:10:08 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -99,7 +99,7 @@ _mesa_alloc_texture_object( struct gl_shared_state *shared, obj->CompareMode = GL_LUMINANCE; /* ARB_shadow */ obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */ obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */ - obj->ShadowAmbient = 0; /* ARB/SGIX_shadow_ambient */ + obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */ _mesa_init_colortable(&obj->Palette); /* insert into linked list */ diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 1287bdf2bf8..e5c82e1514d 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.79 2002/09/27 02:45:38 brianp Exp $ */ +/* $Id: texstate.c,v 1.80 2002/10/04 19:10:08 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1148,28 +1148,16 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); } break; -#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]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[2], params[2]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[3], params[3]); - break; -#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); - texObj->BorderValues[3] = CLAMP(params[3], 0.0F, 1.0F); - UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[0], texObj->BorderValues[0]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[1], texObj->BorderValues[1]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[2], texObj->BorderValues[2]); - UNCLAMPED_FLOAT_TO_CHAN(texObj->BorderColor[3], texObj->BorderValues[3]); + texObj->BorderColor[RCOMP] = params[0]; + texObj->BorderColor[GCOMP] = params[1]; + texObj->BorderColor[BCOMP] = params[2]; + texObj->BorderColor[ACOMP] = params[3]; + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[RCOMP], params[0]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[GCOMP], params[1]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[BCOMP], params[2]); + UNCLAMPED_FLOAT_TO_CHAN(texObj->_BorderChan[ACOMP], params[3]); break; case GL_TEXTURE_MIN_LOD: if (texObj->MinLod == params[0]) @@ -1255,7 +1243,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) 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]); + texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F); } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -1623,21 +1611,11 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) case GL_TEXTURE_WRAP_R_EXT: *params = ENUM_TO_FLOAT(obj->WrapR); return; -#if 0 /* someday */ - case GL_TEXTURE_BORDER_VALUES_NV: - /* unclamped */ - params[0] = obj->BorderValues[0]; - params[1] = obj->BorderValues[1]; - params[2] = obj->BorderValues[2]; - params[3] = obj->BorderValues[3]; - return; -#endif case GL_TEXTURE_BORDER_COLOR: - /* clamped */ - params[0] = obj->BorderColor[0] / CHAN_MAXF; - params[1] = obj->BorderColor[1] / CHAN_MAXF; - params[2] = obj->BorderColor[2] / CHAN_MAXF; - params[3] = obj->BorderColor[3] / CHAN_MAXF; + params[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F); + params[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F); + params[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F); + params[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F); return; case GL_TEXTURE_RESIDENT: { @@ -1684,7 +1662,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) break; case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ if (ctx->Extensions.SGIX_shadow_ambient) { - *params = CHAN_TO_FLOAT(obj->ShadowAmbient); + *params = obj->ShadowAmbient; return; } break; @@ -1750,23 +1728,13 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) case GL_TEXTURE_WRAP_R_EXT: *params = (GLint) obj->WrapR; return; -#if 0 /* someday */ - case GL_TEXTURE_BORDER_VALUES_NV: - /* unclamped */ - params[0] = FLOAT_TO_INT(obj->BorderValues[0]); - params[1] = FLOAT_TO_INT(obj->BorderValues[1]); - params[2] = FLOAT_TO_INT(obj->BorderValues[2]); - params[3] = FLOAT_TO_INT(obj->BorderValues[3]); - return; -#endif case GL_TEXTURE_BORDER_COLOR: - /* clamped */ { GLfloat b[4]; - b[0] = CLAMP(obj->BorderValues[0], 0.0F, 1.0F); - b[1] = CLAMP(obj->BorderValues[1], 0.0F, 1.0F); - b[2] = CLAMP(obj->BorderValues[2], 0.0F, 1.0F); - b[3] = CLAMP(obj->BorderValues[3], 0.0F, 1.0F); + b[0] = CLAMP(obj->BorderColor[0], 0.0F, 1.0F); + b[1] = CLAMP(obj->BorderColor[1], 0.0F, 1.0F); + b[2] = CLAMP(obj->BorderColor[2], 0.0F, 1.0F); + b[3] = CLAMP(obj->BorderColor[3], 0.0F, 1.0F); params[0] = FLOAT_TO_INT(b[0]); params[1] = FLOAT_TO_INT(b[1]); params[2] = FLOAT_TO_INT(b[2]); @@ -1818,8 +1786,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) break; case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ if (ctx->Extensions.SGIX_shadow_ambient) { - GLfloat a = CHAN_TO_FLOAT(obj->ShadowAmbient); - *params = (GLint) FLOAT_TO_INT(a); + *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient); return; } break; |