Commit ce8ef46a authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d8: Upload vertex buffer range relative to base vertex index.

parent 0a41f5b0
......@@ -2344,6 +2344,7 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitive(IDirect3DDevice8 *iface,
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
unsigned int index_count;
int base_vertex_index;
HRESULT hr;
TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, start_idx %u, primitive_count %u.\n",
......@@ -2351,7 +2352,8 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitive(IDirect3DDevice8 *iface,
index_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
wined3d_mutex_lock();
d3d8_device_upload_sysmem_vertex_buffers(device, min_vertex_idx, vertex_count);
base_vertex_index = wined3d_device_get_base_vertex_index(device->wined3d_device);
d3d8_device_upload_sysmem_vertex_buffers(device, base_vertex_index + min_vertex_idx, vertex_count);
d3d8_device_upload_sysmem_index_buffer(device, start_idx, index_count);
wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0);
hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx, index_count);
......
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