Stefan Dösinger : wined3d: Merge two if conditions in buffer.c.

Alexandre Julliard julliard at winehq.org
Wed Mar 17 12:19:06 CDT 2010


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Thu Mar 11 15:21:40 2010 +0100

wined3d: Merge two if conditions in buffer.c.

---

 dlls/wined3d/buffer.c |   29 +++++++++++++----------------
 1 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 6fefe87..3e1ac4c 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -900,6 +900,19 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
             goto end;
         }
         buffer_check_buffer_object_size(This);
+
+        /* The declaration changed, reload the whole buffer */
+        WARN("Reloading buffer because of decl change\n");
+        buffer_clear_dirty_areas(This);
+        if(!buffer_add_dirty_area(This, 0, 0))
+        {
+            ERR("buffer_add_dirty_area failed, this is not expected\n");
+            return;
+        }
+        /* Avoid unfenced updates, we might overwrite more areas of the buffer than the application
+         * cleared for unsynchronized updates
+         */
+        flags = 0;
     }
     else
     {
@@ -927,22 +940,6 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
         }
     }
 
-    if (decl_changed)
-    {
-        /* The declaration changed, reload the whole buffer */
-        WARN("Reloading buffer because of decl change\n");
-        buffer_clear_dirty_areas(This);
-        if(!buffer_add_dirty_area(This, 0, 0))
-        {
-            ERR("buffer_add_dirty_area failed, this is not expected\n");
-            return;
-        }
-        /* Avoid unfenced updates, we might overwrite more areas of the buffer than the application
-         * cleared for unsynchronized updates
-         */
-        flags = 0;
-    }
-
     if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB)
     {
         IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_INDEXBUFFER);




More information about the wine-cvs mailing list