[PATCH 2/5] wined3d: Move location loading and modification together in IWineD3DDeviceImpl_ClearSurface().

Henri Verbeet hverbeet at codeweavers.com
Tue Apr 20 15:38:40 CDT 2010


---
 dlls/wined3d/device.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c840e2a..1d690a0 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4370,10 +4370,11 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
      * the drawable up to date. We have to check all settings that limit the clear area though. Do not bother
      * checking all this if the dest surface is in the drawable anyway.
      */
-    if (Flags & WINED3DCLEAR_TARGET && !(target->Flags & SFLAG_INDRAWABLE))
+    if (Flags & WINED3DCLEAR_TARGET)
     {
-        if (!is_full_clear(target, vp, scissor_rect, clear_rect))
+        if (!(target->Flags & SFLAG_INDRAWABLE) && !is_full_clear(target, vp, scissor_rect, clear_rect))
             IWineD3DSurface_LoadLocation((IWineD3DSurface *)target, SFLAG_INDRAWABLE, NULL);
+        IWineD3DSurface_ModifyLocation((IWineD3DSurface *)target, SFLAG_INDRAWABLE, TRUE);
     }
 
     context = context_acquire(This, (IWineD3DSurface *)target, CTXUSAGE_CLEAR);
@@ -4431,6 +4432,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
         DWORD location = context->render_offscreen ? SFLAG_DS_OFFSCREEN : SFLAG_DS_ONSCREEN;
         if (!(depth_stencil->Flags & location) && !is_full_clear(depth_stencil, vp, scissor_rect, clear_rect))
             surface_load_ds_location(depth_stencil, context, location);
+        surface_modify_ds_location(depth_stencil, location);
 
         glDepthMask(GL_TRUE);
         IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_ZWRITEENABLE));
@@ -4507,16 +4509,6 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
         }
     }
 
-    if (Flags & WINED3DCLEAR_TARGET)
-    {
-        IWineD3DSurface_ModifyLocation((IWineD3DSurface *)target, SFLAG_INDRAWABLE, TRUE);
-    }
-    if (Flags & WINED3DCLEAR_ZBUFFER) {
-        /* Note that WINED3DCLEAR_ZBUFFER implies a depth stencil exists on the device */
-        DWORD location = context->render_offscreen ? SFLAG_DS_OFFSCREEN : SFLAG_DS_ONSCREEN;
-        surface_modify_ds_location(depth_stencil, location);
-    }
-
     LEAVE_GL();
 
     if (wined3d_settings.strict_draw_ordering || ((target->Flags & SFLAG_SWAPCHAIN)
-- 
1.6.4.4




More information about the wine-patches mailing list