Commit 02d3cfe0 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

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

parent fcd51de6
......@@ -3998,14 +3998,19 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
if (changed->scissorRect)
wined3d_device_set_scissor_rects(device, 1, &state->scissor_rect);
for (i = 0; i < ARRAY_SIZE(state->streams); ++i)
{
if (changed->streamSource & (1u << i))
wined3d_device_set_stream_source(device, i, state->streams[i].buffer,
state->streams[i].offset, state->streams[i].stride);
if (changed->streamFreq & (1u << i))
wined3d_device_set_stream_source_freq(device, i,
state->streams[i].frequency | state->streams[i].flags);
map = changed->streamSource;
while (map)
{
i = wined3d_bit_scan(&map);
wined3d_device_set_stream_source(device, i, state->streams[i].buffer,
state->streams[i].offset, state->streams[i].stride);
}
map = changed->streamFreq;
while (map)
{
i = wined3d_bit_scan(&map);
wined3d_device_set_stream_source_freq(device, i,
state->streams[i].frequency | state->streams[i].flags);
}
for (i = 0; i < ARRAY_SIZE(state->textures); ++i)
......
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