=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d8: Upload vertex buffer range relative to base vertex index.

Alexandre Julliard julliard at winehq.org
Mon Jan 7 16:23:00 CST 2019


Module: wine
Branch: master
Commit: ce8ef46ace50f129659e398e054ab91f03e91e04
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ce8ef46ace50f129659e398e054ab91f03e91e04

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Jan  7 14:17:43 2019 +0100

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

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>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 b4d445d..3348125 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);




More information about the wine-cvs mailing list