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

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:27 +03:30 committed by Alexandre Julliard
parent 34992108bb
commit daf754cea3
1 changed files with 6 additions and 4 deletions

View File

@ -2587,6 +2587,7 @@ static DWORD raw_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
const struct wined3d_gl_info *gl_info = context->gl_info;
unsigned int src_sub_resource_idx, dst_sub_resource_idx;
struct wined3d_texture *src_texture, *dst_texture;
unsigned int src_layer, dst_layer;
struct wined3d_blitter *next;
GLuint src_name, dst_name;
DWORD location;
@ -2625,6 +2626,7 @@ static DWORD raw_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
if (!wined3d_texture_load_location(src_texture, src_sub_resource_idx, context, location))
ERR("Failed to load the source sub-resource into %s.\n", wined3d_debug_location(location));
src_name = wined3d_texture_get_texture_name(src_texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
src_layer = src_sub_resource_idx / src_texture->level_count;
location = dst_location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB);
if (!location)
@ -2641,12 +2643,12 @@ static DWORD raw_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
ERR("Failed to load the destination sub-resource into %s.\n", wined3d_debug_location(location));
}
dst_name = wined3d_texture_get_texture_name(dst_texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB);
dst_layer = dst_sub_resource_idx / dst_texture->level_count;
GL_EXTCALL(glCopyImageSubData(src_name, src_texture->target, src_surface->texture_level,
src_rect->left, src_rect->top, src_surface->texture_layer,
dst_name, dst_texture->target, dst_surface->texture_level,
dst_rect->left, dst_rect->top, dst_surface->texture_layer,
src_rect->right - src_rect->left, src_rect->bottom - src_rect->top, 1));
src_rect->left, src_rect->top, src_layer, dst_name, dst_texture->target, dst_surface->texture_level,
dst_rect->left, dst_rect->top, dst_layer, src_rect->right - src_rect->left,
src_rect->bottom - src_rect->top, 1));
checkGLcall("copy image data");
wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, location);