[PATCH 3/5] wined3d: Set the surface pitch for user-memory surfaces. (v2)

Matteo Bruni mbruni at codeweavers.com
Wed Feb 18 07:20:47 CST 2015


v2: Add a comment, also pass 1 as the alignment value to
wined3d_format_calculate_size.
---
 dlls/wined3d/surface.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 8f60769..a42e907 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2212,10 +2212,16 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface,
     surface->resource.multisample_type = texture_resource->multisample_type;
     surface->resource.multisample_quality = texture_resource->multisample_quality;
     if (surface->pitch)
+    {
         surface->resource.size = height * surface->pitch;
+    }
     else
+    {
+        /* User memory surfaces don't have the regular surface alignment. */
         surface->resource.size = wined3d_format_calculate_size(texture_resource->format,
-                texture_resource->device->surface_alignment, width, height, 1);
+                1, width, height, 1);
+        surface->pitch = wined3d_format_calculate_pitch(texture_resource->format, width);
+    }
 
     /* The format might be changed to a format that needs conversion.
      * If the surface didn't use PBOs previously but could now, don't
-- 
2.0.5




More information about the wine-patches mailing list