Henri Verbeet : wined3d: Source and destination formats should match in IWineD3DDeviceImpl_UpdateSurface ().

Alexandre Julliard julliard at winehq.org
Tue Mar 30 10:39:45 CDT 2010


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Mar 30 11:24:45 2010 +0200

wined3d: Source and destination formats should match in IWineD3DDeviceImpl_UpdateSurface().

---

 dlls/wined3d/device.c |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 351d038..caa9568 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5194,6 +5194,12 @@ static HRESULT  WINAPI  IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
         return WINED3DERR_INVALIDCALL;
     }
 
+    if (srcFormat != destFormat)
+    {
+        WARN("Source and destination surfaces should have the same format.\n");
+        return WINED3DERR_INVALIDCALL;
+    }
+
     /* This call loads the opengl surface directly, instead of copying the surface to the
      * destination's sysmem copy. If surface conversion is needed, use BltFast instead to
      * copy in sysmem and use regular surface loading.
@@ -5206,14 +5212,6 @@ static HRESULT  WINAPI  IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
                                         pSourceSurface, pSourceRect, 0);
     }
 
-    if (destFormat == WINED3DFMT_UNKNOWN) {
-        TRACE("(%p) : Converting destination surface from WINED3DFMT_UNKNOWN to the source format\n", This);
-        IWineD3DSurface_SetFormat(pDestinationSurface, srcFormat);
-
-        /* Get the update surface description */
-        IWineD3DSurface_GetDesc(pDestinationSurface, &winedesc);
-    }
-
     context = context_acquire(This, NULL, CTXUSAGE_RESOURCELOAD);
 
     ENTER_GL();
@@ -5292,15 +5290,9 @@ static HRESULT  WINAPI  IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
                 /* FIXME: The easy way to do this is to lock the destination, and copy the bits across. */
                 FIXME("Updating part of a compressed texture is not supported.\n");
             }
-            if (destFormat != srcFormat)
-            {
-                FIXME("Updating mixed format compressed textures is not supported.\n");
-            }
-            else
-            {
-                GL_EXTCALL(glCompressedTexImage2DARB(dst_impl->texture_target, dst_impl->texture_level,
-                        dst_format_desc->glInternal, srcWidth, srcHeight, 0, destSize, data));
-            }
+
+            GL_EXTCALL(glCompressedTexImage2DARB(dst_impl->texture_target, dst_impl->texture_level,
+                    dst_format_desc->glInternal, srcWidth, srcHeight, 0, destSize, data));
         }
         checkGLcall("glCompressedTexSubImage2DARB");
     }




More information about the wine-cvs mailing list