diff options
author | Mathias Fröhlich <[email protected]> | 2016-05-22 14:10:19 +0200 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2016-06-16 05:50:53 +0200 |
commit | b60c7302357c2ceb0297d5ef2f748c9b686dbad5 (patch) | |
tree | 04f64cf8c7c57dd6e41768dfedfc21e35448dde0 /src/mesa/main/enable.c | |
parent | 6749d77c690d2254b8ed3f16a653c41565ebab49 (diff) |
mesa: Track enabled lights in a bitmask
This enables some optimizations afterwards.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r-- | src/mesa/main/enable.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 1d674bf39f6..bc59280f090 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -402,10 +402,12 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) 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; |