Henri Verbeet : wined3d: Use wined3d_texture_get_sub_resource_target() in fb_copy_to_texture_direct().

Alexandre Julliard julliard at winehq.org
Thu Feb 22 15:07:46 CST 2018


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Feb 22 10:54:55 2018 +0330

wined3d: Use wined3d_texture_get_sub_resource_target() in fb_copy_to_texture_direct().

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

---

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

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index eafe47f..dfdcd9c 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1580,6 +1580,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
     BOOL upsidedown = FALSE;
     RECT dst_rect = *dst_rect_in;
     unsigned int src_height;
+    GLenum dst_target;
 
     /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
      * glCopyTexSubImage is a bit picky about the parameters we pass to it
@@ -1627,12 +1628,13 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
     }
 
     src_height = wined3d_texture_get_level_height(src_texture, src_surface->texture_level);
+    dst_target = wined3d_texture_get_sub_resource_target(dst_texture, dst_sub_resource_idx);
     if (upsidedown
             && !((xrel - 1.0f < -eps) || (xrel - 1.0f > eps))
             && !((yrel - 1.0f < -eps) || (yrel - 1.0f > eps)))
     {
         /* Upside down copy without stretching is nice, one glCopyTexSubImage call will do. */
-        gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_surface->texture_target, dst_surface->texture_level,
+        gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_surface->texture_level,
                 dst_rect.left /*xoffset */, dst_rect.top /* y offset */,
                 src_rect->left, src_height - src_rect->bottom,
                 dst_rect.right - dst_rect.left, dst_rect.bottom - dst_rect.top);
@@ -1657,14 +1659,14 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
 
                 for (col = dst_rect.left; col < dst_rect.right; ++col)
                 {
-                    gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_surface->texture_target, dst_surface->texture_level,
+                    gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_surface->texture_level,
                             dst_rect.left + col /* x offset */, row /* y offset */,
                             src_rect->left + col * xrel, yoffset - (int) (row * yrel), 1, 1);
                 }
             }
             else
             {
-                gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_surface->texture_target, dst_surface->texture_level,
+                gl_info->gl_ops.gl.p_glCopyTexSubImage2D(dst_target, dst_surface->texture_level,
                         dst_rect.left /* x offset */, row /* y offset */,
                         src_rect->left, yoffset - (int) (row * yrel), dst_rect.right - dst_rect.left, 1);
             }




More information about the wine-cvs mailing list