[PATCH 1/4] wined3d: Use wined3d_texture_get_pitch() in surface_load_texture().
Riccardo Bortolato
rikyz619 at gmail.com
Thu Feb 11 15:51:41 CST 2016
Signed-off-by: Riccardo Bortolato <rikyz619 at gmail.com>
---
dlls/wined3d/surface.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 45cefca..dc54808 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3683,7 +3683,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
{
const struct wined3d_gl_info *gl_info = context->gl_info;
RECT src_rect = {0, 0, surface->resource.width, surface->resource.height};
- unsigned int width, src_pitch, dst_row_pitch, dst_slice_pitch;
+ unsigned int width, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
struct wined3d_device *device = surface->resource.device;
const struct wined3d_color_key_conversion *conversion;
struct wined3d_texture *texture = surface->container;
@@ -3771,7 +3771,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
wined3d_texture_bind_and_dirtify(texture, context, srgb);
width = surface->resource.width;
- src_pitch = wined3d_surface_get_pitch(surface);
+ wined3d_texture_get_pitch(surface->container, surface->texture_level, &src_row_pitch, &src_slice_pitch);
format = *texture->resource.format;
if ((conversion = wined3d_format_get_color_key_conversion(texture, TRUE)))
@@ -3809,9 +3809,9 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
context_release(context);
return E_OUTOFMEMORY;
}
- format.convert(data.addr, mem, src_pitch, src_pitch * height,
+ format.convert(data.addr, mem, src_row_pitch, src_row_pitch * height,
dst_row_pitch, dst_slice_pitch, width, height, 1);
- src_pitch = dst_row_pitch;
+ src_row_pitch = dst_row_pitch;
data.addr = mem;
}
else if (conversion)
@@ -3831,14 +3831,14 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
}
if (texture->swapchain && texture->swapchain->palette)
palette = texture->swapchain->palette;
- conversion->convert(data.addr, src_pitch, mem, dst_row_pitch,
+ conversion->convert(data.addr, src_row_pitch, mem, dst_row_pitch,
width, height, palette, &texture->async.gl_color_key);
- src_pitch = dst_row_pitch;
+ src_row_pitch = dst_row_pitch;
data.addr = mem;
}
wined3d_surface_upload_data(surface, gl_info, &format, &src_rect,
- src_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
+ src_row_pitch, &dst_point, srgb, wined3d_const_bo_address(&data));
HeapFree(GetProcessHeap(), 0, mem);
--
1.9.1
More information about the wine-patches
mailing list