mesa: make sure all lighting tables are updated before the computation
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 15 Nov 2011 07:40:53 +0000 (15:40 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 16 Nov 2011 03:20:49 +0000 (11:20 +0800)
Make sure all lighting tables are updated before using the table to
calculate something, say using _SpotExpTable to calculate
_VP_inf_spot_attenuation.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/light.c

index c27cf1dd38b0a44661506c0037478426c4aea82c..60daa89a33f6c6be4fb860b1bb4cf9c8132f6aeb 100644 (file)
@@ -1138,6 +1138,9 @@ compute_light_positions( struct gl_context *ctx )
       TRANSFORM_NORMAL( ctx->_EyeZDir, eye_z, ctx->ModelviewMatrixStack.Top->m );
    }
 
+   /* Make sure all the light tables are updated before the computation */
+   _mesa_validate_all_lighting_tables(ctx);
+
    foreach (light, &ctx->Light.EnabledList) {
 
       if (ctx->_NeedEyeCoords) {