Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/surface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 657127f..0d09c2f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -748,7 +748,8 @@ static void surface_download_data(struct wined3d_surface *surface, const struct } else if (temporary_mem) { - void *src_data = temporary_mem + surface->texture_layer * sub_resource->size; + unsigned int layer = sub_resource_idx / texture->level_count; + void *src_data = temporary_mem + layer * sub_resource->size; if (data.buffer_object) { GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, data.buffer_object));