mesa: Remove the linked list of enabled lights

Clean up after conversion to bitmasks.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
This commit is contained in:
Mathias Fröhlich 2016-05-22 14:10:19 +02:00
parent 21f7f67685
commit b5820759de
4 changed files with 1 additions and 22 deletions

View File

@ -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 */

View File

@ -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:

View File

@ -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 );

View File

@ -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];
/*@}*/