wined3d: Introduce a stateblock flag for lights.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
194b1234a9
commit
0d2a1ecced
|
@ -3904,6 +3904,8 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
|
|||
wined3d_device_set_ps_consts_b(device, range.offset, range.size, &state->ps_consts_b[range.offset]);
|
||||
}
|
||||
|
||||
if (changed->lights)
|
||||
{
|
||||
for (i = 0; i < ARRAY_SIZE(state->light_state->light_map); ++i)
|
||||
{
|
||||
const struct wined3d_light_info *light;
|
||||
|
@ -3914,6 +3916,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
|
|||
wined3d_device_set_light_enable(device, light->OriginalIndex, light->glIndex != -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((set_blend_state = changed->blend_state
|
||||
|| wined3d_bitmap_is_set(changed->renderState, WINED3D_RS_ADAPTIVETESS_Y)))
|
||||
|
|
|
@ -209,6 +209,7 @@ static void stateblock_savedstates_set_all(struct wined3d_saved_states *states,
|
|||
states->vertexShader = 1;
|
||||
states->scissorRect = 1;
|
||||
states->blend_state = 1;
|
||||
states->lights = 1;
|
||||
|
||||
states->streamSource = 0xffff;
|
||||
states->streamFreq = 0xffff;
|
||||
|
@ -262,6 +263,7 @@ static void stateblock_savedstates_set_vertex(struct wined3d_saved_states *state
|
|||
states->vertexDecl = 1;
|
||||
states->vertexShader = 1;
|
||||
states->blend_state = 1;
|
||||
states->lights = 1;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(vertex_states_render); ++i)
|
||||
{
|
||||
|
@ -982,6 +984,7 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock,
|
|||
stateblock->stateblock_state.ps = state->ps;
|
||||
}
|
||||
|
||||
if (stateblock->changed.lights)
|
||||
wined3d_state_record_lights(stateblock->stateblock_state.light_state, state->light_state);
|
||||
|
||||
if (stateblock->changed.blend_state && stateblock->stateblock_state.blend_state != state->blend_state)
|
||||
|
@ -1050,6 +1053,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
|
|||
wined3d_device_set_vs_consts_b(device, idx, 1, &stateblock->stateblock_state.vs_consts_b[idx]);
|
||||
}
|
||||
|
||||
if (stateblock->changed.lights)
|
||||
{
|
||||
for (i = 0; i < ARRAY_SIZE(stateblock->stateblock_state.light_state->light_map); ++i)
|
||||
{
|
||||
const struct wined3d_light_info *light;
|
||||
|
@ -1066,6 +1071,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock,
|
|||
wined3d_device_set_light_enable(device, light->OriginalIndex, light->glIndex != -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stateblock->changed.pixelShader)
|
||||
{
|
||||
|
@ -1708,6 +1714,7 @@ HRESULT CDECL wined3d_stateblock_set_stream_source_freq(struct wined3d_statebloc
|
|||
stateblock->changed.streamFreq |= 1u << stream_idx;
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_stateblock_set_light(struct wined3d_stateblock *stateblock,
|
||||
UINT light_idx, const struct wined3d_light *light)
|
||||
{
|
||||
|
@ -1744,6 +1751,7 @@ HRESULT CDECL wined3d_stateblock_set_light(struct wined3d_stateblock *stateblock
|
|||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
stateblock->changed.lights = 1;
|
||||
return wined3d_light_state_set_light(stateblock->stateblock_state.light_state, light_idx, light, &object);
|
||||
}
|
||||
|
||||
|
@ -1761,6 +1769,7 @@ HRESULT CDECL wined3d_stateblock_set_light_enable(struct wined3d_stateblock *sta
|
|||
return hr;
|
||||
}
|
||||
wined3d_light_state_enable_light(light_state, &stateblock->device->adapter->d3d_info, light_info, enable);
|
||||
stateblock->changed.lights = 1;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -3937,7 +3937,8 @@ struct wined3d_saved_states
|
|||
DWORD scissorRect : 1;
|
||||
DWORD store_stream_offset : 1;
|
||||
DWORD blend_state : 1;
|
||||
DWORD padding : 3;
|
||||
DWORD lights : 1;
|
||||
DWORD padding : 2;
|
||||
};
|
||||
|
||||
struct StageState {
|
||||
|
|
Loading…
Reference in New Issue