[PATCH 4/5] wined3d: Explicitly calculate the sub-resource layer in raw_blitter_blit().
Henri Verbeet
hverbeet at codeweavers.com
Fri Feb 23 00:18:27 CST 2018
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
dlls/wined3d/surface.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b2df8f9..9c0d039 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -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);
--
2.1.4
More information about the wine-devel
mailing list