Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/device.c | 7 ++++--- dlls/wined3d/wined3d_private.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6474b02cccc..660ba777efc 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4022,10 +4022,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, wined3d_device_set_texture(device, stage, state->textures[i]); }
- for (i = 0; i < ARRAY_SIZE(state->clip_planes); ++i) + map = changed->clipplane; + while (map) { - if (changed->clipplane & (1u << i)) - wined3d_device_set_clip_plane(device, i, &state->clip_planes[i]); + i = wined3d_bit_scan(&map); + wined3d_device_set_clip_plane(device, i, &state->clip_planes[i]); }
memset(&stateblock->changed, 0, sizeof(stateblock->changed)); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 15e376c8328..744e647008e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3926,7 +3926,7 @@ struct wined3d_saved_states DWORD renderState[(WINEHIGHEST_RENDER_STATE >> 5) + 1]; DWORD textureState[WINED3D_MAX_TEXTURES]; /* WINED3D_HIGHEST_TEXTURE_STATE + 1, 18 */ WORD samplerState[WINED3D_MAX_COMBINED_SAMPLERS]; /* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14 */ - DWORD clipplane; /* WINED3D_MAX_USER_CLIP_PLANES, 32 */ + DWORD clipplane; /* WINED3D_MAX_CLIP_DISTANCES, 8 */ DWORD textures : 20; /* WINED3D_MAX_COMBINED_SAMPLERS, 20 */ DWORD indices : 1; DWORD material : 1;