[Mesa-dev] [PATCH 2/7] mesa: Remove gl_light_attrib::_Flags.

Mathias Fröhlich Mathias.Froehlich at gmx.net
Wed Feb 29 10:47:07 PST 2012


This variable is only used locally in _mesa_update_lighting.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich at web.de>
---
 src/mesa/main/light.c      |    8 ++++----
 src/mesa/main/mtypes.h     |    1 -
 src/mesa/x86/gen_matypes.c |    1 -
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 552efa7..7ebf9bf 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1003,23 +1003,23 @@ _mesa_validate_all_lighting_tables( struct gl_context 
*ctx )
 void
 _mesa_update_lighting( struct gl_context *ctx )
 {
+   GLbitfield flags = 0;
    struct gl_light *light;
    ctx->Light._NeedEyeCoords = GL_FALSE;
-   ctx->Light._Flags = 0;
 
    if (!ctx->Light.Enabled)
       return;
 
    foreach(light, &ctx->Light.EnabledList) {
-      ctx->Light._Flags |= light->_Flags;
+      flags |= light->_Flags;
    }
 
    ctx->Light._NeedVertices =
-      ((ctx->Light._Flags & (LIGHT_POSITIONAL|LIGHT_SPOT)) ||
+      ((flags & (LIGHT_POSITIONAL|LIGHT_SPOT)) ||
        ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR ||
        ctx->Light.Model.LocalViewer);
 
-   ctx->Light._NeedEyeCoords = ((ctx->Light._Flags & LIGHT_POSITIONAL) ||
+   ctx->Light._NeedEyeCoords = ((flags & LIGHT_POSITIONAL) ||
 				ctx->Light.Model.LocalViewer);
 
    /* XXX: This test is overkill & needs to be fixed both for software and
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b5753df..2f5f85f 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -966,7 +966,6 @@ struct gl_light_attrib
    /*@{*/
    GLboolean _NeedEyeCoords;		
    GLboolean _NeedVertices;		/**< Use fast shader? */
-   GLbitfield _Flags;		        /**< LIGHT_* flags, see above */
    GLfloat _BaseColor[2][3];
    /*@}*/
 };
diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c
index 7af82b4..4fe99e7 100644
--- a/src/mesa/x86/gen_matypes.c
+++ b/src/mesa/x86/gen_matypes.c
@@ -103,7 +103,6 @@ int main( int argc, char **argv )
    OFFSET( "CTX_LIGHT_COLOR_MAT_ENABLED ", struct gl_context, 
Light.ColorMaterialEnabled );
    OFFSET( "CTX_LIGHT_ENABLED_LIST      ", struct gl_context, 
Light.EnabledList );
    OFFSET( "CTX_LIGHT_NEED_VERTS        ", struct gl_context, 
Light._NeedVertices );
-   OFFSET( "CTX_LIGHT_FLAGS             ", struct gl_context, Light._Flags );
    OFFSET( "CTX_LIGHT_BASE_COLOR        ", struct gl_context, 
Light._BaseColor );
 
 
-- 
1.7.7.6


More information about the mesa-dev mailing list