From b5820759de6338811dfe0295de34849b41c1c64f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mathias=20Fr=C3=B6hlich?= Date: Sun, 22 May 2016 14:10:19 +0200 Subject: [PATCH] mesa: Remove the linked list of enabled lights MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Clean up after conversion to bitmasks. Reviewed-by: Brian Paul Signed-off-by: Mathias Fröhlich --- src/mesa/main/context.c | 11 +---------- src/mesa/main/enable.c | 4 ---- src/mesa/main/light.c | 4 ---- src/mesa/main/mtypes.h | 4 ---- 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 85cd779..c30031e 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -120,7 +120,6 @@ #include "shared.h" #include "shaderobj.h" #include "shaderimage.h" -#include "util/simple_list.h" #include "util/strtod.h" #include "state.h" #include "stencil.h" @@ -1413,16 +1412,8 @@ _mesa_copy_context( const struct gl_context *src, struct gl_context *dst, dst->Hint = src->Hint; } if (mask & GL_LIGHTING_BIT) { - GLuint i; - /* begin with memcpy */ + /* OK to memcpy */ dst->Light = src->Light; - /* fixup linked lists to prevent pointer insanity */ - make_empty_list( &(dst->Light.EnabledList) ); - for (i = 0; i < MAX_LIGHTS; i++) { - if (dst->Light.Light[i].Enabled) { - insert_at_tail(&(dst->Light.EnabledList), &(dst->Light.Light[i])); - } - } } if (mask & GL_LINE_BIT) { /* OK to memcpy */ diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index bc59280..1468a45 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -35,7 +35,6 @@ #include "enable.h" #include "errors.h" #include "light.h" -#include "util/simple_list.h" #include "mtypes.h" #include "enums.h" #include "api_arrayelt.h" @@ -403,12 +402,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Light.Light[cap-GL_LIGHT0].Enabled = state; if (state) { ctx->Light._EnabledLights |= 1u << (cap - GL_LIGHT0); - insert_at_tail(&ctx->Light.EnabledList, - &ctx->Light.Light[cap-GL_LIGHT0]); } else { ctx->Light._EnabledLights &= ~(1u << (cap - GL_LIGHT0)); - remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]); } break; case GL_LIGHTING: diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index c9e2fc2..ad9cef1 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -31,7 +31,6 @@ #include "enums.h" #include "light.h" #include "macros.h" -#include "util/simple_list.h" #include "mtypes.h" #include "math/m_matrix.h" #include "util/bitscan.h" @@ -1122,8 +1121,6 @@ _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag ) static void init_light( struct gl_light *l, GLuint n ) { - make_empty_list( l ); - ASSIGN_4V( l->Ambient, 0.0, 0.0, 0.0, 1.0 ); if (n==0) { ASSIGN_4V( l->Diffuse, 1.0, 1.0, 1.0, 1.0 ); @@ -1197,7 +1194,6 @@ _mesa_init_lighting( struct gl_context *ctx ) for (i = 0; i < MAX_LIGHTS; i++) { init_light( &ctx->Light.Light[i], i ); } - make_empty_list( &ctx->Light.EnabledList ); init_lightmodel( &ctx->Light.Model ); init_material( &ctx->Light.Material ); diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index bea589f..87e3c0c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -333,9 +333,6 @@ struct gl_material */ struct gl_light { - struct gl_light *next; /**< double linked list with sentinel */ - struct gl_light *prev; - GLfloat Ambient[4]; /**< ambient color */ GLfloat Diffuse[4]; /**< diffuse color */ GLfloat Specular[4]; /**< specular color */ @@ -634,7 +631,6 @@ struct gl_light_attrib GLboolean _NeedEyeCoords; GLboolean _NeedVertices; /**< Use fast shader? */ - struct gl_light EnabledList; /**< List sentinel */ GLfloat _BaseColor[2][3]; /*@}*/ -- 2.7.4