From a9678a1a8c0a160b0e1378ef0581f1cdff322cd1 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 26 Feb 2018 10:21:50 +0330 Subject: [PATCH] wined3d: Explicitly calculate the sub-resource level in arbfp_blitter_blit(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/arb_program_shader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 9823de23d07..f86c167b606 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7825,6 +7825,8 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl == WINED3D_LOCATION_DRAWABLE && !wined3d_resource_is_offscreen(&src_texture->resource)) { + unsigned int src_level = src_sub_resource_idx % src_texture->level_count; + /* Without FBO blits transferring from the drawable to the texture is * expensive, because we have to flip the data in sysmem. Since we can * flip in the blitter, we don't actually need that flip anyway. So we @@ -7833,8 +7835,8 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl surface_load_fb_texture(src_surface, FALSE, context); s = *src_rect; - s.top = wined3d_texture_get_level_height(src_texture, src_surface->texture_level) - s.top; - s.bottom = wined3d_texture_get_level_height(src_texture, src_surface->texture_level) - s.bottom; + s.top = wined3d_texture_get_level_height(src_texture, src_level) - s.top; + s.bottom = wined3d_texture_get_level_height(src_texture, src_level) - s.bottom; src_rect = &s; } else