Henri Verbeet : wined3d: Check for GPU access before attempting an upload blit in texture2d_blt().

Alexandre Julliard julliard at winehq.org
Tue Jun 2 16:34:09 CDT 2020


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Jun  2 04:05:01 2020 +0430

wined3d: Check for GPU access before attempting an upload blit in texture2d_blt().

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

---

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

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 503f9f45e1..ba34938828 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1537,12 +1537,6 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
 
     flags &= ~(WINED3D_BLT_SYNCHRONOUS | WINED3D_BLT_DO_NOT_WAIT | WINED3D_BLT_WAIT);
 
-    if (!device->d3d_initialized)
-    {
-        WARN("D3D not initialized, using CPU blit fallback.\n");
-        goto cpu;
-    }
-
     if (flags & ~simple_blit)
     {
         WARN_(d3d_perf)("Using CPU fallback for complex blit (%#x).\n", flags);
@@ -1629,7 +1623,8 @@ HRESULT texture2d_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_
         blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST;
     }
     else if ((src_sub_resource->locations & surface_simple_locations)
-            && !(dst_sub_resource->locations & surface_simple_locations))
+            && !(dst_sub_resource->locations & surface_simple_locations)
+            && (dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU))
     {
         /* Upload */
         if (scale)




More information about the wine-cvs mailing list