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

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

parent ebc96e32
...@@ -3961,14 +3961,16 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, ...@@ -3961,14 +3961,16 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
} }
} }
for (i = 0; i < ARRAY_SIZE(state->sampler_states); ++i) for (i = 0; i < ARRAY_SIZE(changed->samplerState); ++i)
{ {
DWORD stage = i; DWORD stage = i;
if (stage >= WINED3D_MAX_FRAGMENT_SAMPLERS) if (stage >= WINED3D_MAX_FRAGMENT_SAMPLERS)
stage += WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS; stage += WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS;
for (j = 0; j < ARRAY_SIZE(state->sampler_states[j]); ++j) map = changed->samplerState[i];
while (map)
{ {
if (changed->samplerState[i] & (1 << j)) j = wined3d_bit_scan(&map);
wined3d_device_set_sampler_state(device, stage, j, state->sampler_states[i][j]); wined3d_device_set_sampler_state(device, stage, j, state->sampler_states[i][j]);
} }
} }
......
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