Commit c7d3a8a4 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Drop the "vbo" check in wined3d_device_process_vertices().

We care about individual streams having a VBO or not, and there's no way for device_stream_info_from_declaration() to properly express that, so just check the individual streams.
parent 8e88a5a6
...@@ -3452,11 +3452,12 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, ...@@ -3452,11 +3452,12 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf) const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf)
{ {
struct wined3d_state *state = &device->stateBlock->state; struct wined3d_state *state = &device->stateBlock->state;
BOOL vbo = FALSE, streamWasUP = state->user_stream;
struct wined3d_stream_info stream_info; struct wined3d_stream_info stream_info;
const struct wined3d_gl_info *gl_info; const struct wined3d_gl_info *gl_info;
BOOL streamWasUP = state->user_stream;
struct wined3d_context *context; struct wined3d_context *context;
struct wined3d_shader *vs; struct wined3d_shader *vs;
unsigned int i;
HRESULT hr; HRESULT hr;
TRACE("device %p, src_start_idx %u, dst_idx %u, vertex_count %u, " TRACE("device %p, src_start_idx %u, dst_idx %u, vertex_count %u, "
...@@ -3477,23 +3478,21 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, ...@@ -3477,23 +3478,21 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
vs = state->vertex_shader; vs = state->vertex_shader;
state->vertex_shader = NULL; state->vertex_shader = NULL;
state->user_stream = FALSE; state->user_stream = FALSE;
device_stream_info_from_declaration(device, &stream_info, &vbo); device_stream_info_from_declaration(device, &stream_info, NULL);
state->user_stream = streamWasUP; state->user_stream = streamWasUP;
state->vertex_shader = vs; state->vertex_shader = vs;
if (vbo || src_start_idx) /* We can't convert FROM a VBO, and vertex buffers used to source into
{ * process_vertices() are unlikely to ever be used for drawing. Release
unsigned int i; * VBOs in those buffers and fix up the stream_info structure.
/* ProcessVertices can't convert FROM a vbo, and vertex buffers used to source into ProcessVertices are
* unlikely to ever be used for drawing. Release vbos in those buffers and fix up the stream_info structure
* *
* Also get the start index in, but only loop over all elements if there's something to add at all. * Also apply the start index. */
*/
for (i = 0; i < (sizeof(stream_info.elements) / sizeof(*stream_info.elements)); ++i) for (i = 0; i < (sizeof(stream_info.elements) / sizeof(*stream_info.elements)); ++i)
{ {
struct wined3d_stream_info_element *e; struct wined3d_stream_info_element *e;
if (!(stream_info.use_map & (1 << i))) continue; if (!(stream_info.use_map & (1 << i)))
continue;
e = &stream_info.elements[i]; e = &stream_info.elements[i];
if (e->data.buffer_object) if (e->data.buffer_object)
...@@ -3509,7 +3508,6 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, ...@@ -3509,7 +3508,6 @@ HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device,
if (e->data.addr) if (e->data.addr)
e->data.addr += e->stride * src_start_idx; e->data.addr += e->stride * src_start_idx;
} }
}
hr = process_vertices_strided(device, dst_idx, vertex_count, hr = process_vertices_strided(device, dst_idx, vertex_count,
&stream_info, dst_buffer, flags, dst_fvf); &stream_info, dst_buffer, flags, dst_fvf);
......
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