This enables some optimizations afterwards.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
FLUSH_VERTICES(ctx, _NEW_LIGHT);
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;
GLuint i;
/* Lighting group */
+ ctx->Light._EnabledLights = 0;
for (i = 0; i < MAX_LIGHTS; i++) {
init_light( &ctx->Light.Light[i], i );
}
* Derived state for optimizations:
*/
/*@{*/
+ GLbitfield _EnabledLights; /**< bitmask containing enabled lights */
+
GLboolean _NeedEyeCoords;
GLboolean _NeedVertices; /**< Use fast shader? */
struct gl_light EnabledList; /**< List sentinel */