Mesa (master): mesa: Avoid using the shine table for _tnl_RasterPos

Mathias Fröhlich frohlich at kemper.freedesktop.org
Wed Feb 29 19:42:11 UTC 2012


Module: Mesa
Branch: master
Commit: a1b1f8ff866f8ce48cfc83c9d9dd9f636d05d2a7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a1b1f8ff866f8ce48cfc83c9d9dd9f636d05d2a7

Author: Mathias Fröhlich <Mathias.Froehlich at gmx.net>
Date:   Wed Feb 29 18:19:34 2012 +0100

mesa: Avoid using the shine table for _tnl_RasterPos

Use direct computation of pow for computing the shininess
in _tnl_RasterPos. Since the _tnl_RasterPos function is still
used by plenty drivers that do only need the shine table for
_tnl_RasterPos but do not make use of swtnl computations, this
enables pushing down the shine table computation and validation
into the tnl module, which will happen in a followup change.

Reviewed-by: Alex Deucher <alexdeucher at gmail.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich at web.de>

---

 src/mesa/tnl/t_rasterpos.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c
index 17611cd..38f63b2 100644
--- a/src/mesa/tnl/t_rasterpos.c
+++ b/src/mesa/tnl/t_rasterpos.c
@@ -214,7 +214,11 @@ shade_rastpos(struct gl_context *ctx,
 	 n_dot_h = DOT3(normal, h);
 
 	 if (n_dot_h > 0.0F) {
-	    GLfloat spec_coef = _mesa_lookup_shininess(ctx, 0, n_dot_h);
+	    GLfloat shine;
+	    GLfloat spec_coef;
+
+	    shine = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0];
+	    spec_coef = powf(n_dot_h, shine);
 
 	    if (spec_coef > 1.0e-10) {
                if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {




More information about the mesa-commit mailing list