diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index f054b43a00c..a0ca8babd24 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -4289,12 +4289,6 @@ 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) - dst_target = dst_surface->container->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 @@ -4312,7 +4306,7 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struc surface_internal_preload(dst_surface, context, SRGB_RGB); /* Bind the target texture */ - context_bind_texture(context, dst_target, dst_surface->texture_name); + context_bind_texture(context, dst_surface->container->target, dst_surface->texture_name); if (surface_is_offscreen(src_surface)) { TRACE("Reading from an offscreen target\n");