Stefan Dösinger : wined3d: Remove the d3d7 do-not-convert code.

Alexandre Julliard julliard at winehq.org
Tue Dec 29 09:06:39 CST 2009


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed Dec 23 14:23:27 2009 +0100

wined3d: Remove the d3d7 do-not-convert code.

---

 dlls/d3d8/vertexbuffer.c |    2 +-
 dlls/d3d9/vertexbuffer.c |    2 +-
 dlls/wined3d/device.c    |   12 ------------
 include/wine/wined3d.idl |    3 +--
 4 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/dlls/d3d8/vertexbuffer.c b/dlls/d3d8/vertexbuffer.c
index 9a984f2..18cc7b3 100644
--- a/dlls/d3d8/vertexbuffer.c
+++ b/dlls/d3d8/vertexbuffer.c
@@ -272,7 +272,7 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Im
 
     wined3d_mutex_lock();
     hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size,
-            (usage & WINED3DUSAGE_MASK) | WINED3DUSAGE_OPTIMIZE, 0,
+            usage & WINED3DUSAGE_MASK, 0,
             (WINED3DPOOL)pool, &buffer->wineD3DVertexBuffer,
             (IUnknown *)buffer, &d3d8_vertexbuffer_wined3d_parent_ops);
     wined3d_mutex_unlock();
diff --git a/dlls/d3d9/vertexbuffer.c b/dlls/d3d9/vertexbuffer.c
index 7ea394c..4eeb5c1 100644
--- a/dlls/d3d9/vertexbuffer.c
+++ b/dlls/d3d9/vertexbuffer.c
@@ -273,7 +273,7 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer9Impl *buffer, IDirect3DDevice9Im
 
     wined3d_mutex_lock();
     hr = IWineD3DDevice_CreateVertexBuffer(device->WineD3DDevice, size,
-            (usage & WINED3DUSAGE_MASK) | WINED3DUSAGE_OPTIMIZE, 0,
+            usage & WINED3DUSAGE_MASK, 0,
             (WINED3DPOOL)pool, &buffer->wineD3DVertexBuffer,
             (IUnknown *)buffer, &d3d9_vertexbuffer_wined3d_parent_ops);
     wined3d_mutex_unlock();
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 31b3187..edc2409 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -486,7 +486,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
     struct wined3d_buffer *object;
     HRESULT hr;
-    BOOL conv;
 
     if (Pool == WINED3DPOOL_SCRATCH)
     {
@@ -525,16 +524,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac
      * Basically converting the vertices in the buffer is quite expensive, and observations
      * show that drawStridedSlow is faster than converting + uploading + drawStridedFast.
      * Therefore do not create a VBO for WINED3DUSAGE_DYNAMIC buffers.
-     *
-     * Direct3D7 has another problem: Its vertexbuffer api doesn't offer a way to specify
-     * the range of vertices being locked, so each lock will require the whole buffer to be transformed.
-     * Moreover geometry data in dx7 is quite simple, so drawStridedSlow isn't a big hit. A plus
-     * is that the vertex buffers fvf can be trusted in dx7. So only create non-converted vbos for
-     * dx7 apps.
-     * There is a IDirect3DVertexBuffer7::Optimize call after which the buffer can't be locked any
-     * more. In this call we can convert dx7 buffers too.
      */
-    conv = ((FVF & WINED3DFVF_POSITION_MASK) == WINED3DFVF_XYZRHW ) || (FVF & (WINED3DFVF_DIFFUSE | WINED3DFVF_SPECULAR));
     if (!This->adapter->gl_info.supported[ARB_VERTEX_BUFFER_OBJECT])
     {
         TRACE("Not creating a vbo because GL_ARB_vertex_buffer is not supported\n");
@@ -542,8 +532,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac
         TRACE("Not creating a vbo because the vertex buffer is in system memory\n");
     } else if(Usage & WINED3DUSAGE_DYNAMIC) {
         TRACE("Not creating a vbo because the buffer has dynamic usage\n");
-    } else if(!(Usage & WINED3DUSAGE_OPTIMIZE) && conv) {
-        TRACE("Not creating a vbo because the fvf needs conversion, but VB optimization is disabled\n");
     } else {
         object->flags |= WINED3D_BUFFER_CREATEBO;
     }
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 7196a98..ec69655 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -904,8 +904,7 @@ const UINT WINED3DUSAGE_DYNAMIC                                 = 0x00000200;
 const UINT WINED3DUSAGE_AUTOGENMIPMAP                           = 0x00000400;
 const UINT WINED3DUSAGE_DMAP                                    = 0x00004000;
 const UINT WINED3DUSAGE_MASK                                    = 0x00004fff;
-const UINT WINED3DUSAGE_STATICDECL                              = 0x20000000;
-const UINT WINED3DUSAGE_OPTIMIZE                                = 0x40000000;
+const UINT WINED3DUSAGE_STATICDECL                              = 0x40000000;
 const UINT WINED3DUSAGE_OVERLAY                                 = 0x80000000;
 
 const UINT WINED3DUSAGE_QUERY_LEGACYBUMPMAP                     = 0x00008000;




More information about the wine-cvs mailing list