[PATCH 1/3] wined3d: Fix NP2 surface repacking in surface_download_data.

Matteo Bruni mbruni at codeweavers.com
Wed Jun 19 14:59:24 CDT 2013


It was erroneously skipping the first row of the texture since
b48dfb3c547f060270b96e51f6bebc9ce1d0a891 AFAICS. This codepath is only
used for very old GPUs so no surprise nobody noticed earlier.
---
 dlls/wined3d/surface.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index a325ac0..83ff41f 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2246,12 +2246,11 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
             src_data = mem;
             dst_data = surface->resource.allocatedMemory;
             TRACE("(%p) : Repacking the surface data from pitch %d to pitch %d\n", surface, src_pitch, dst_pitch);
-            for (y = 1; y < surface->resource.height; ++y)
+            for (y = 0; y < surface->resource.height; ++y)
             {
-                /* skip the first row */
+                memcpy(dst_data, src_data, dst_pitch);
                 src_data += src_pitch;
                 dst_data += dst_pitch;
-                memcpy(dst_data, src_data, dst_pitch);
             }
 
             HeapFree(GetProcessHeap(), 0, mem);
-- 
1.8.1.5




More information about the wine-patches mailing list