wined3d: Simplify remove_vbos().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-10-24 11:57:26 +02:00 committed by Alexandre Julliard
parent 6454242009
commit 6c5e1aff04
1 changed files with 4 additions and 3 deletions

View File

@ -391,18 +391,19 @@ static void remove_vbos(struct wined3d_context *context,
{ {
unsigned int i; unsigned int i;
for (i = 0; i < (sizeof(s->elements) / sizeof(*s->elements)); ++i) for (i = 0; i < ARRAY_SIZE(s->elements); ++i)
{ {
struct wined3d_stream_info_element *e; struct wined3d_stream_info_element *e;
if (!(s->use_map & (1u << i))) continue; if (!(s->use_map & (1u << i)))
continue;
e = &s->elements[i]; e = &s->elements[i];
if (e->data.buffer_object) if (e->data.buffer_object)
{ {
struct wined3d_buffer *vb = state->streams[e->stream_idx].buffer; struct wined3d_buffer *vb = state->streams[e->stream_idx].buffer;
e->data.buffer_object = 0; e->data.buffer_object = 0;
e->data.addr = (BYTE *)((ULONG_PTR)e->data.addr + (ULONG_PTR)wined3d_buffer_load_sysmem(vb, context)); e->data.addr += (ULONG_PTR)wined3d_buffer_load_sysmem(vb, context);
} }
} }
} }