[8/16] WineD3D: Pass the user pointer strided data via the device

Stefan Dösinger stefandoesinger at gmx.at
Mon Jan 1 18:13:43 CST 2007


The vertex declaration / stream sources state will need this later
-------------- next part --------------
From 71a475308e705b9110df344793a34965ceb25256 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Stefan_D=C3=B6singer?= <stefan at imac.local>
Date: Wed, 27 Dec 2006 14:08:57 +0100
Subject: [PATCH] WineD3D: Pass the user pointer strided data over the device impl structure

---
 dlls/wined3d/device.c          |   12 +++++++-----
 dlls/wined3d/drawprim.c        |    7 +++----
 dlls/wined3d/wined3d_private.h |    4 ++--
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index e4a6ab6..b3984c0 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4670,7 +4670,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
         IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL);
     }
     drawPrimitive(iface, PrimitiveType, PrimitiveCount, StartVertex, 0/* NumVertices */, -1 /* indxStart */,
-                  0 /* indxSize */, NULL /* indxData */, 0 /* minIndex */, NULL);
+                  0 /* indxSize */, NULL /* indxData */, 0 /* minIndex */);
 
 
     return WINED3D_OK;
@@ -4707,7 +4707,7 @@ static HRESULT  WINAPI  IWineD3DDeviceIm
     }
 
     drawPrimitive(iface, PrimitiveType, primCount, 0, NumVertices, startIndex,
-                   idxStride, ((IWineD3DIndexBufferImpl *) pIB)->resource.allocatedMemory, minIndex, NULL);
+                   idxStride, ((IWineD3DIndexBufferImpl *) pIB)->resource.allocatedMemory, minIndex);
 
     return WINED3D_OK;
 }
@@ -4736,7 +4736,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     This->baseVIndex = 0;
 
     drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0 /* start vertex */, 0  /* NumVertices */,
-                  0 /* indxStart*/, 0 /* indxSize*/, NULL /* indxData */, 0 /* indxMin */, NULL);
+                  0 /* indxStart*/, 0 /* indxSize*/, NULL /* indxData */, 0 /* indxMin */);
 
     /* MSDN specifies stream zero settings must be set to NULL */
     This->stateBlock->streamStride[0] = 0;
@@ -4782,7 +4782,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL);
     This->baseVIndex = 0;
 
-    drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0 /* vertexStart */, NumVertices, 0 /* indxStart */, idxStride, pIndexData, MinVertexIndex, NULL);
+    drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0 /* vertexStart */, NumVertices, 0 /* indxStart */, idxStride, pIndexData, MinVertexIndex);
 
     /* MSDN specifies stream zero settings and index buffer must be set to NULL */
     This->stateBlock->streamSource[0] = NULL;
@@ -4798,7 +4798,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     /* Mark the state dirty until we have nicer tracking */
     IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VDECL);
     This->baseVIndex = 0;
-    drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0, 0, 0, 0, NULL, 0, DrawPrimStrideData);
+    This->up_strided = DrawPrimStrideData;
+    drawPrimitive(iface, PrimitiveType, PrimitiveCount, 0, 0, 0, 0, NULL, 0);
+    This->up_strided = NULL;
     return WINED3D_OK;
 }
  /* Yet another way to update a texture, some apps use this to load default textures instead of using surface/texture lock/unlock */
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 644f1ff..6ec3574 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -1936,8 +1936,7 @@ void drawPrimitive(IWineD3DDevice *iface
                    long  StartIdx,
                    short idxSize,
                    const void *idxData,
-                   int   minIndex,
-                   WineDirect3DVertexStridedData *DrawPrimStrideData) {
+                   int   minIndex) {
 
     IWineD3DDeviceImpl           *This = (IWineD3DDeviceImpl *)iface;
     BOOL                          useVertexShaderFunction = FALSE;
@@ -1991,12 +1990,12 @@ void drawPrimitive(IWineD3DDevice *iface
     }
     This->depth_copy_state = WINED3D_DCS_INITIAL;
 
-    if(DrawPrimStrideData) {
+    if(This->up_strided) {
 
         /* Note: this is a ddraw fixed-function code path */
 
         TRACE("================ Strided Input ===================\n");
-		memcpy(&This->strided_streams, DrawPrimStrideData, sizeof(This->strided_streams));
+		memcpy(&This->strided_streams, This->up_strided, sizeof(This->strided_streams));
         drawPrimitiveTraceDataLocations(&This->strided_streams);
         fixup = FALSE;
     }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f5a6dd3..03cd9cd 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -382,8 +382,7 @@ void drawPrimitive(IWineD3DDevice *iface
                     long  StartIdx,
                     short idxBytes,
                     const void *idxData,
-                    int   minIndex,
-                    WineDirect3DVertexStridedData *DrawPrimStrideData);
+                    int   minIndex);
 
 void primitiveConvertToStridedData(IWineD3DDevice *iface, WineDirect3DVertexStridedData *strided, BOOL *fixup);
 
@@ -669,6 +668,7 @@ #define                         NEEDS_DI
 	
     /* Stream source management */
     WineDirect3DVertexStridedData strided_streams;
+    WineDirect3DVertexStridedData *up_strided;
     UINT                      baseVIndex;
 
 } IWineD3DDeviceImpl;
-- 
1.4.2.4

-------------- next part --------------



More information about the wine-patches mailing list