wined3d: Explicitly calculate the sub-resource layer in surface_download_data().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-02-23 09:48:25 +03:30 committed by Alexandre Julliard
parent cb4b757410
commit cd53e81a80
1 changed files with 2 additions and 1 deletions

View File

@ -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));