Henri Verbeet : wined3d: Explicitly calculate the sub-resource level in surface_blt_special().

Alexandre Julliard julliard at winehq.org
Thu Mar 1 13:34:43 CST 2018


Module: wine
Branch: master
Commit: 28d0ee637a6517d0e53d8722fa70a5e8ec639d77
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=28d0ee637a6517d0e53d8722fa70a5e8ec639d77

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Mar  1 10:04:52 2018 +0330

wined3d: Explicitly calculate the sub-resource level in surface_blt_special().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/surface.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 668cfba..b6235ce 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2113,7 +2113,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
 
     if ((src_swapchain || src_surface == rt) && !dst_swapchain)
     {
-        unsigned int src_width, src_height;
+        unsigned int src_level, src_width, src_height;
         /* Blit from render target to texture */
         BOOL stretchx;
 
@@ -2147,8 +2147,9 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
          *    back buffer. This is slower than reading line per line, thus not used for flipping
          * -> If the app wants a scaled image with a dest rect that is bigger than the fb, it has to be copied
          *    pixel by pixel. */
-        src_width = wined3d_texture_get_level_width(src_texture, src_surface->texture_level);
-        src_height = wined3d_texture_get_level_height(src_texture, src_surface->texture_level);
+        src_level = surface_get_sub_resource_idx(src_surface) % src_texture->level_count;
+        src_width = wined3d_texture_get_level_width(src_texture, src_level);
+        src_height = wined3d_texture_get_level_height(src_texture, src_level);
         if (!stretchx || dst_rect->right - dst_rect->left > src_width
                 || dst_rect->bottom - dst_rect->top > src_height)
         {




More information about the wine-cvs mailing list