[13/15] WineD3D: D3D7 vertex buffers never change their declaration

Stefan Dösinger stefan at codeweavers.com
Wed Jan 10 04:43:27 CST 2007


The d3d7 vbs have the fvf stored in them, and 
IDirect3DDevice7::DrawIndexedPrimitiveVB just calls SetFVF to set it. Knowing 
that a device is used for d3d7 we can safe the cpu cycles for comparing the 
declaration.
-------------- next part --------------
From c3cee05d1296ee03af5ad26bb9f65480e88ef41a Mon Sep 17 00:00:00 2001
From: Stefan Doesinger <stefan at codeweavers.com>
Date: Sun, 7 Jan 2007 14:09:53 +0100
Subject: [PATCH] WineD3D: D3D7 vertex buffers never change their declaration

---
 dlls/wined3d/vertexbuffer.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/vertexbuffer.c b/dlls/wined3d/vertexbuffer.c
index 181c244..da22469 100644
--- a/dlls/wined3d/vertexbuffer.c
+++ b/dlls/wined3d/vertexbuffer.c
@@ -165,6 +165,13 @@ inline BOOL WINAPI IWineD3DVertexBufferImpl_FindDecl(IWineD3DVertexBufferImpl *T
     WineDirect3DVertexStridedData strided;
     IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
 
+    /* In d3d7 the vertex buffer declaration NEVER changes because it is stored in the d3d7 vertex buffer.
+     * Once we have our declaration there is no need to look it up again.
+     */
+    if(((IWineD3DImpl *)device->wineD3D)->dxVersion == 7 && This->Flags & VBFLAG_HASDESC) {
+        return FALSE;
+    }
+
     memset(&strided, 0, sizeof(strided));
     /* There are certain vertex data types that need to be fixed up. The Vertex Buffers FVF doesn't
      * help finding them, only the vertex declaration or the device FVF can determine that at drawPrim
-- 
1.4.4.3



More information about the wine-patches mailing list