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

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

parent e32b8e81
...@@ -3837,10 +3837,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, ...@@ -3837,10 +3837,11 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
{ {
const struct wined3d_stateblock_state *state = &stateblock->stateblock_state; const struct wined3d_stateblock_state *state = &stateblock->stateblock_state;
const struct wined3d_saved_states *changed = &stateblock->changed; const struct wined3d_saved_states *changed = &stateblock->changed;
const unsigned int word_bit_count = sizeof(DWORD) * CHAR_BIT;
struct wined3d_blend_state *blend_state; struct wined3d_blend_state *blend_state;
unsigned int i, j, start, idx;
struct wined3d_color colour; struct wined3d_color colour;
struct wined3d_range range; struct wined3d_range range;
unsigned int i, j, start;
BOOL set_blend_state; BOOL set_blend_state;
DWORD map; DWORD map;
...@@ -3968,10 +3969,15 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, ...@@ -3968,10 +3969,15 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
} }
} }
for (i = 0; i < ARRAY_SIZE(state->transforms); ++i) for (i = 0; i < ARRAY_SIZE(changed->transform); ++i)
{ {
if (wined3d_bitmap_is_set(changed->transform, i)) map = changed->transform[i];
wined3d_device_set_transform(device, i, &state->transforms[i]); while (map)
{
j = wined3d_bit_scan(&map);
idx = i * word_bit_count + j;
wined3d_device_set_transform(device, idx, &state->transforms[idx]);
}
} }
if (changed->indices) if (changed->indices)
......
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