Commit ad5f230a authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Optimize scanning changed clip planes in wined3d_device_apply_stateblock().

parent aa21b022
......@@ -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));
......
......@@ -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;
......
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