[PATCH 1/4] d3d8: Upload vertex buffer range relative to base vertex index.

Józef Kucia jkucia at codeweavers.com
Mon Jan 7 07:17:43 CST 2019


Fixes a regression introduced by 75b7ff60562880b6e7b646a8fa84486670162d00.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46357
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/d3d8/device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index b4d445d63d38..334812540e86 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -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);
-- 
2.19.2




More information about the wine-devel mailing list