Henri Verbeet : wined3d: Use the proper texture target in fb_copy_to_texture_direct().

Alexandre Julliard julliard at winehq.org
Tue Jul 17 11:05:34 CDT 2012


Module: wine
Branch: master
Commit: 092ba1e1bf7edfaa7321ac003f8efed76bd9a638
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=092ba1e1bf7edfaa7321ac003f8efed76bd9a638

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Jul 17 11:40:36 2012 +0200

wined3d: Use the proper texture target in fb_copy_to_texture_direct().

---

 dlls/wined3d/surface.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 3fa10d1..c0b27ba 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4888,6 +4888,12 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
     struct wined3d_context *context;
     BOOL upsidedown = FALSE;
     RECT dst_rect = *dst_rect_in;
+    GLenum dst_target;
+
+    if (dst_surface->container.type == WINED3D_CONTAINER_TEXTURE)
+        dst_target = dst_surface->container.u.texture->target;
+    else
+        dst_target = dst_surface->texture_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
@@ -4905,7 +4911,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc
     ENTER_GL();
 
     /* Bind the target texture */
-    context_bind_texture(context, dst_surface->texture_target, dst_surface->texture_name);
+    context_bind_texture(context, dst_target, dst_surface->texture_name);
     if (surface_is_offscreen(src_surface))
     {
         TRACE("Reading from an offscreen target\n");




More information about the wine-cvs mailing list