H. Verbeet : wined3d: Call LoadLocation() on higher render targets as well, simplify some code in drawPrimitive.

Alexandre Julliard julliard at winehq.org
Thu Jul 31 07:18:04 CDT 2008


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

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Wed Jul 30 23:16:34 2008 +0200

wined3d: Call LoadLocation() on higher render targets as well, simplify some code in drawPrimitive.

It's probably rare for higher render targets to get locked or updated
from sysmem, but this should still be more correct. It also makes the
code simpler.

---

 dlls/wined3d/drawprim.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index fddf365..fd96ea2 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -930,17 +930,9 @@ void drawPrimitive(IWineD3DDevice *iface,
     /* Invalidate the back buffer memory so LockRect will read it the next time */
     for(i = 0; i < GL_LIMITS(buffers); i++) {
         target = (IWineD3DSurfaceImpl *) This->render_targets[i];
-
-        /* TODO: Only do all that if we're going to change anything */
-        if(target /*&& target->Flags & (SFLAG_INTEXTURE | SFLAG_INSYSMEM)*/) {
-            if(i == 0) {
-                /* Need the surface in the drawable! */
-                IWineD3DSurface_LoadLocation((IWineD3DSurface *) target, SFLAG_INDRAWABLE, NULL);
-                IWineD3DSurface_ModifyLocation((IWineD3DSurface *) target, SFLAG_INDRAWABLE, TRUE);
-            } else {
-                /* Must be an fbo render target */
-                IWineD3DSurface_ModifyLocation((IWineD3DSurface *) target, SFLAG_INDRAWABLE, TRUE);
-            }
+        if (target) {
+            IWineD3DSurface_LoadLocation((IWineD3DSurface *) target, SFLAG_INDRAWABLE, NULL);
+            IWineD3DSurface_ModifyLocation((IWineD3DSurface *) target, SFLAG_INDRAWABLE, TRUE);
         }
     }
 




More information about the wine-cvs mailing list