wined3d: Simplify IWineD3DVertexBufferImpl_PreLoad() a bit.

Henri Verbeet hverbeet at codeweavers.com
Fri Mar 6 01:43:49 CST 2009


---
 dlls/wined3d/buffer.c |   23 +++--------------------
 1 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index c0d92c5..6c78905 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -747,20 +747,8 @@ static void STDMETHODCALLTYPE IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuf
     {
         declChanged = IWineD3DVertexBufferImpl_FindDecl(This);
     }
-    else if (This->Flags & VBFLAG_HASDESC)
-    {
-        /* Reuse the declaration stored in the buffer. It will most likely not change, and if it does
-         * the stream source state handler will call PreLoad again and the change will be caught
-         */
-    }
-    else
-    {
-        /* Cannot get a declaration, and no declaration is stored in the buffer. It is pointless to preload
-         * now. When the buffer is used, PreLoad will be called by the stream source state handler and a valid
-         * declaration for the buffer can be found
-         */
-        return;
-    }
+
+    if (!declChanged && This->Flags & (VBFLAG_HASDESC | VBFLAG_DIRTY) != (VBFLAG_HASDESC | VBFLAG_DIRTY)) return;
 
     /* If applications change the declaration over and over, reconverting all the time is a huge
      * performance hit. So count the declaration changes and release the VBO if there are too many
@@ -810,7 +798,7 @@ static void STDMETHODCALLTYPE IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuf
         start = 0;
         end = This->resource.size;
     }
-    else if(This->Flags & VBFLAG_DIRTY)
+    else
     {
         /* No decl change, but dirty data, reload the changed stuff */
         if (This->conv_shift)
@@ -823,11 +811,6 @@ static void STDMETHODCALLTYPE IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuf
         start = This->dirtystart;
         end = This->dirtyend;
     }
-    else
-    {
-        /* Desc not changed, buffer not dirty, nothing to do :-) */
-        return;
-    }
 
     /* Mark the buffer clean */
     This->Flags &= ~VBFLAG_DIRTY;
-- 
1.6.0.6



--------------090201020706000808070400--



More information about the wine-patches mailing list