From 4155c22e25464f4aa6fa121a786b34d748664bd4 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 10 Feb 2016 19:30:00 +0100 Subject: [PATCH] wined3d: Use wined3d_texture_get_pitch() in wined3d_surface_map(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/surface.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 95ee2552504..45cefca998f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2414,10 +2414,15 @@ HRESULT wined3d_surface_map(struct wined3d_surface *surface, struct wined3d_map_ } if (fmt_flags & WINED3DFMT_FLAG_BROKEN_PITCH) + { map_desc->row_pitch = surface->resource.width * format->byte_count; + map_desc->slice_pitch = surface->resource.height * map_desc->row_pitch; + } else - map_desc->row_pitch = wined3d_surface_get_pitch(surface); - map_desc->slice_pitch = surface->resource.height * map_desc->row_pitch; + { + wined3d_texture_get_pitch(surface->container, surface->texture_level, + &map_desc->row_pitch, &map_desc->slice_pitch); + } if (!box) {