Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 12 ++++++++---- dlls/wined3d/stateblock.c | 7 ++++--- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f23e76f37e..d7b5bbc000 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1768,19 +1768,23 @@ HRESULT CDECL wined3d_device_set_clip_plane(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; }
+ device->update_stateblock_state->clip_planes[plane_idx] = *plane; + if (device->recording) + { device->recording->changed.clipplane |= 1u << plane_idx; + return WINED3D_OK; + }
- if (!memcmp(&device->update_state->clip_planes[plane_idx], plane, sizeof(*plane))) + 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; } diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index c1a5d02b78..55cf0e64a2 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -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); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ee69549114..647ef90e19 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -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