Commit e78bb552 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Store clip planes in the wined3d_stateblock_state structure.

parent b041cecf
......@@ -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;
}
......
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment