wined3d: Optimize scanning changed texture states in wined3d_device_apply_stateblock().

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2020-02-28 11:24:59 +01:00 committed by Alexandre Julliard
parent 1cea81d104
commit ebc96e32bd
1 changed files with 5 additions and 4 deletions

View File

@ -3951,11 +3951,12 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
} }
} }
for (i = 0; i < ARRAY_SIZE(state->texture_states); ++i) for (i = 0; i < ARRAY_SIZE(changed->textureState); ++i)
{ {
for (j = 0; j < ARRAY_SIZE(state->texture_states[i]); ++j) map = changed->textureState[i];
while (map)
{ {
if (changed->textureState[i] & (1u << j)) j = wined3d_bit_scan(&map);
wined3d_device_set_texture_stage_state(device, i, j, state->texture_states[i][j]); wined3d_device_set_texture_stage_state(device, i, j, state->texture_states[i][j]);
} }
} }