[PATCH] ddraw: Allow GPU access to D3DVBCAPS_SYSTEMMEMORY vertex buffers.

Matteo Bruni mbruni at codeweavers.com
Mon Oct 15 10:02:45 CDT 2018


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45279
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
The original Deus Ex uses a D3DVBCAPS_SYSTEMMEMORY buffer with
DrawPrimitiveVB() and expects it to work.

It should also help with bug 45279 and 45486.

The device is probably created with
D3DCREATE_SOFTWARE_VERTEXPROCESSING, which would explain why this is
accepted on Windows. With core profile we need to create a VBO anyway
so I think this is the correct fix in practice.

This is an alternative to
https://source.winehq.org/patches/data/152581, main difference is
fixing the issue in ddraw instead of wined3d.

 dlls/ddraw/vertexbuffer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c
index 3ad8f7e1bdd..6a1f010bd31 100644
--- a/dlls/ddraw/vertexbuffer.c
+++ b/dlls/ddraw/vertexbuffer.c
@@ -125,7 +125,8 @@ static HRESULT d3d_vertex_buffer_create_wined3d_buffer(struct d3d_vertex_buffer
         desc.usage |= WINED3DUSAGE_DYNAMIC;
     desc.bind_flags = WINED3D_BIND_VERTEX_BUFFER;
     if (buffer->Caps & D3DVBCAPS_SYSTEMMEMORY)
-        desc.access = WINED3D_RESOURCE_ACCESS_CPU | WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
+        desc.access = WINED3D_RESOURCE_ACCESS_CPU | WINED3D_RESOURCE_ACCESS_GPU
+            | WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
     else
         desc.access = WINED3D_RESOURCE_ACCESS_GPU | WINED3D_RESOURCE_ACCESS_MAP_R | WINED3D_RESOURCE_ACCESS_MAP_W;
     desc.misc_flags = 0;
-- 
2.18.1




More information about the wine-devel mailing list