wined3d: Store clip planes in the wined3d_stateblock_state structure.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-02-05 23:01:05 -06:00 committed by Alexandre Julliard
parent b041cecfa1
commit e78bb5529e
3 changed files with 15 additions and 9 deletions

View File

@ -1768,19 +1768,23 @@ HRESULT CDECL wined3d_device_set_clip_plane(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL;
}
if (device->recording)
device->recording->changed.clipplane |= 1u << plane_idx;
device->update_stateblock_state->clip_planes[plane_idx] = *plane;
if (!memcmp(&device->update_state->clip_planes[plane_idx], plane, sizeof(*plane)))
if (device->recording)
{
device->recording->changed.clipplane |= 1u << plane_idx;
return WINED3D_OK;
}
if (!memcmp(&device->state.clip_planes[plane_idx], plane, sizeof(*plane)))
{
TRACE("Application is setting old values over, nothing to do.\n");
return WINED3D_OK;
}
device->update_state->clip_planes[plane_idx] = *plane;
device->state.clip_planes[plane_idx] = *plane;
if (!device->recording)
wined3d_cs_emit_set_clip_plane(device->cs, plane_idx, plane);
wined3d_cs_emit_set_clip_plane(device->cs, plane_idx, plane);
return WINED3D_OK;
}

View File

@ -915,10 +915,10 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
{
if (!(map & 1)) continue;
if (memcmp(&stateblock->state.clip_planes[i], &src_state->clip_planes[i], sizeof(src_state->clip_planes[i])))
if (memcmp(&stateblock->stateblock_state.clip_planes[i], &state->clip_planes[i], sizeof(state->clip_planes[i])))
{
TRACE("Updating clipplane %u.\n", i);
stateblock->state.clip_planes[i] = src_state->clip_planes[i];
stateblock->stateblock_state.clip_planes[i] = state->clip_planes[i];
}
}
@ -1177,7 +1177,8 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
{
if (!(map & 1)) continue;
wined3d_device_set_clip_plane(device, i, &stateblock->state.clip_planes[i]);
state->clip_planes[i] = stateblock->stateblock_state.clip_planes[i];
wined3d_device_set_clip_plane(device, i, &stateblock->stateblock_state.clip_planes[i]);
}
TRACE("Applied stateblock %p.\n", stateblock);

View File

@ -2987,6 +2987,7 @@ struct wined3d_stateblock_state
DWORD texture_states[MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1];
struct wined3d_vec4 clip_planes[MAX_CLIP_DISTANCES];
};
struct wined3d_device