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

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


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

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

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

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

---

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

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b6235ce..a339171 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2226,6 +2226,7 @@ static BOOL surface_load_drawable(struct wined3d_surface *surface,
     struct wined3d_texture *texture = surface->container;
     struct wined3d_surface *restore_rt = NULL;
     struct wined3d_device *device;
+    unsigned int level;
     RECT r;
 
     if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL)
@@ -2250,8 +2251,9 @@ static BOOL surface_load_drawable(struct wined3d_surface *surface,
     else
         restore_rt = NULL;
 
-    SetRect(&r, 0, 0, wined3d_texture_get_level_width(texture, surface->texture_level),
-            wined3d_texture_get_level_height(texture, surface->texture_level));
+    level = sub_resource_idx % texture->level_count;
+    SetRect(&r, 0, 0, wined3d_texture_get_level_width(texture, level),
+            wined3d_texture_get_level_height(texture, level));
     wined3d_texture_load_location(texture, sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
     device->blitter->ops->blitter_blit(device->blitter, WINED3D_BLIT_OP_COLOR_BLIT, context,
             surface, WINED3D_LOCATION_TEXTURE_RGB, &r,




More information about the wine-cvs mailing list