mesa: Remove unused _mesa_allow_light_in_model
authorAdam Jackson <ajax@redhat.com>
Thu, 16 Dec 2021 01:02:14 +0000 (20:02 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 4 Jan 2022 19:45:54 +0000 (19:45 +0000)
ctx::_ForceEyeCoords is now never not false, so remove and simplify to
match.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14220>

src/mesa/main/light.c
src/mesa/main/light.h
src/mesa/main/mtypes.h

index 9ce69e7..26a73e0 100644 (file)
@@ -1131,8 +1131,7 @@ _mesa_update_tnl_spaces( struct gl_context *ctx, GLuint new_state )
    (void) new_state;
    ctx->_NeedEyeCoords = GL_FALSE;
 
-   if (ctx->_ForceEyeCoords ||
-       (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) ||
+   if ((ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) ||
        ctx->Point._Attenuated ||
        ctx->Light._NeedEyeCoords)
       ctx->_NeedEyeCoords = GL_TRUE;
@@ -1169,19 +1168,6 @@ _mesa_update_tnl_spaces( struct gl_context *ctx, GLuint new_state )
 }
 
 
-/**
- * Drivers may need this if the hardware tnl unit doesn't support the
- * light-in-modelspace optimization.  It's also useful for debugging.
- */
-void
-_mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag )
-{
-   ctx->_ForceEyeCoords = !flag;
-   ctx->NewState |= _NEW_TNL_SPACES;
-}
-
-
-
 /**********************************************************************/
 /*****                      Initialization                        *****/
 /**********************************************************************/
@@ -1289,7 +1275,6 @@ _mesa_init_lighting( struct gl_context *ctx )
    /* Miscellaneous */
    ctx->Light._NeedEyeCoords = GL_FALSE;
    ctx->_NeedEyeCoords = GL_FALSE;
-   ctx->_ForceEyeCoords = GL_FALSE;
    ctx->_ModelViewInvScale = 1.0;
    ctx->_ModelViewInvScaleEyespace = 1.0;
 }
index 8fb40c4..2f9e281 100644 (file)
@@ -52,6 +52,4 @@ extern void _mesa_update_color_material( struct gl_context *ctx,
 
 extern void _mesa_init_lighting( struct gl_context *ctx );
 
-extern void _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag );
-
 #endif
index 7466625..e321d58 100644 (file)
@@ -5398,7 +5398,6 @@ struct gl_context
    GLfloat _ModelViewInvScale; /* may be for model- or eyespace lighting */
    GLfloat _ModelViewInvScaleEyespace; /* always factor defined in spec */
    GLboolean _NeedEyeCoords;
-   GLboolean _ForceEyeCoords;
 
    GLuint TextureStateTimestamp; /**< detect changes to shared state */