From a1d369e804623663e78002c0101d668bd3d42762 Mon Sep 17 00:00:00 2001 From: Tiziano Bacocco Date: Wed, 21 Jan 2015 00:41:11 +0100 Subject: st/nine: Fix enabled lights in stateblocks Reviewed-by: Axel Davy Signed-off-by: Tiziano Bacocco --- src/gallium/state_trackers/nine/device9.c | 4 +++- src/gallium/state_trackers/nine/stateblock9.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index fe251fe3ce0..c6bd052dc8f 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -1965,7 +1965,9 @@ NineDevice9_GetLightEnable( struct NineDevice9 *This, for (i = 0; i < state->ff.num_lights_active; ++i) if (state->ff.active_light[i] == Index) break; - *pEnable = i != state->ff.num_lights_active; + + *pEnable = i != state->ff.num_lights_active ? 128 : 0; // Taken from wine + return D3D_OK; } diff --git a/src/gallium/state_trackers/nine/stateblock9.c b/src/gallium/state_trackers/nine/stateblock9.c index 220b19618b1..13217ae4547 100644 --- a/src/gallium/state_trackers/nine/stateblock9.c +++ b/src/gallium/state_trackers/nine/stateblock9.c @@ -275,7 +275,8 @@ nine_state_copy_common(struct nine_state *dst, if (mask->ff.light[i].Type != NINED3DLIGHT_INVALID) dst->ff.light[i] = src->ff.light[i]; - DBG("TODO: active lights\n"); + memcpy(dst->ff.active_light, src->ff.active_light, sizeof(src->ff.active_light) ); + dst->ff.num_lights_active = src->ff.num_lights_active; } if (mask->changed.group & NINE_STATE_FF_VSTRANSF) { for (i = 0; i < Elements(mask->ff.changed.transform); ++i) { @@ -415,7 +416,8 @@ nine_state_copy_common_all(struct nine_state *dst, memcpy(dst->ff.light, src->ff.light, src->ff.num_lights * sizeof(dst->ff.light[0])); - DBG("TODO: active lights\n"); + memcpy(dst->ff.active_light, src->ff.active_light, sizeof(src->ff.active_light) ); + dst->ff.num_lights_active = src->ff.num_lights_active; } /* Transforms. */ -- cgit v1.2.3