summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-02-08 20:11:58 -0700
committerBrian Paul <[email protected]>2012-02-10 08:06:57 -0700
commit9d9111108eadd65708899284b1cfa9ca425f3ac8 (patch)
tree7c1dadd69f9bd5e2f3758e091a322ded49092b0c /src/mesa/tnl
parentd1b79672425115b0f6f9fc3aadcf3800f5f3a7dc (diff)
mesa: replace GET_SHINE_TAB_ENTRY() macro with an inline function
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_rasterpos.c3
-rw-r--r--src/mesa/tnl/t_vb_lighttmp.h27
2 files changed, 8 insertions, 22 deletions
diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c
index bdd6129e727..17611cd216a 100644
--- a/src/mesa/tnl/t_rasterpos.c
+++ b/src/mesa/tnl/t_rasterpos.c
@@ -214,8 +214,7 @@ shade_rastpos(struct gl_context *ctx,
n_dot_h = DOT3(normal, h);
if (n_dot_h > 0.0F) {
- GLfloat spec_coef;
- GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec_coef );
+ GLfloat spec_coef = _mesa_lookup_shininess(ctx, 0, n_dot_h);
if (spec_coef > 1.0e-10) {
if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {
diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h
index 0b8c314685e..1041a24e761 100644
--- a/src/mesa/tnl/t_vb_lighttmp.h
+++ b/src/mesa/tnl/t_vb_lighttmp.h
@@ -204,10 +204,7 @@ static void TAG(light_rgba_spec)( struct gl_context *ctx,
n_dot_h = correction * DOT3(normal, h);
if (n_dot_h > 0.0F) {
- GLfloat spec_coef;
- struct gl_shine_tab *tab = ctx->_ShineTable[side];
- GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef );
-
+ GLfloat spec_coef = _mesa_lookup_shininess(ctx, side, n_dot_h);
if (spec_coef > 1.0e-10) {
spec_coef *= attenuation;
ACC_SCALE_SCALAR_3V( spec[side], spec_coef,
@@ -385,13 +382,8 @@ static void TAG(light_rgba)( struct gl_context *ctx,
n_dot_h = correction * DOT3(normal, h);
- if (n_dot_h > 0.0F)
- {
- GLfloat spec_coef;
- struct gl_shine_tab *tab = ctx->_ShineTable[side];
-
- GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef );
-
+ if (n_dot_h > 0.0F) {
+ GLfloat spec_coef = _mesa_lookup_shininess(ctx, side, n_dot_h);
ACC_SCALE_SCALAR_3V( contrib, spec_coef,
light->_MatSpecular[side]);
}
@@ -491,8 +483,7 @@ static void TAG(light_fast_rgba_single)( struct gl_context *ctx,
COPY_3V(sum, base[1]);
ACC_SCALE_SCALAR_3V(sum, -n_dot_VP, light->_MatDiffuse[1]);
if (n_dot_h > 0.0F) {
- GLfloat spec;
- GET_SHINE_TAB_ENTRY( ctx->_ShineTable[1], n_dot_h, spec );
+ GLfloat spec = _mesa_lookup_shininess(ctx, 1, n_dot_h);
ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[1]);
}
COPY_3V(Bcolor[j], sum );
@@ -506,10 +497,8 @@ static void TAG(light_fast_rgba_single)( struct gl_context *ctx,
COPY_3V(sum, base[0]);
ACC_SCALE_SCALAR_3V(sum, n_dot_VP, light->_MatDiffuse[0]);
if (n_dot_h > 0.0F) {
- GLfloat spec;
- GET_SHINE_TAB_ENTRY( ctx->_ShineTable[0], n_dot_h, spec );
+ GLfloat spec = _mesa_lookup_shininess(ctx, 0, n_dot_h);
ACC_SCALE_SCALAR_3V(sum, spec, light->_MatSpecular[0]);
-
}
COPY_3V(Fcolor[j], sum );
Fcolor[j][3] = base[0][3];
@@ -600,8 +589,7 @@ static void TAG(light_fast_rgba)( struct gl_context *ctx,
ACC_SCALE_SCALAR_3V(sum[0], n_dot_VP, light->_MatDiffuse[0]);
n_dot_h = DOT3(normal, light->_h_inf_norm);
if (n_dot_h > 0.0F) {
- struct gl_shine_tab *tab = ctx->_ShineTable[0];
- GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec );
+ spec = _mesa_lookup_shininess(ctx, 0, n_dot_h);
ACC_SCALE_SCALAR_3V( sum[0], spec, light->_MatSpecular[0]);
}
}
@@ -610,8 +598,7 @@ static void TAG(light_fast_rgba)( struct gl_context *ctx,
ACC_SCALE_SCALAR_3V(sum[1], -n_dot_VP, light->_MatDiffuse[1]);
n_dot_h = -DOT3(normal, light->_h_inf_norm);
if (n_dot_h > 0.0F) {
- struct gl_shine_tab *tab = ctx->_ShineTable[1];
- GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec );
+ spec = _mesa_lookup_shininess(ctx, 1, n_dot_h);
ACC_SCALE_SCALAR_3V( sum[1], spec, light->_MatSpecular[1]);
}
}