[PATCH 5/5] wined3d: Use the resource access flags in ffp_blit_supported().

Henri Verbeet hverbeet at codeweavers.com
Mon Jan 29 11:40:26 CST 2018


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/surface.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index fb28117..520f88c 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2664,18 +2664,19 @@ static void ffp_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_
     HeapFree(GetProcessHeap(), 0, blitter);
 }
 
-static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info,
-        const struct wined3d_d3d_info *d3d_info, enum wined3d_blit_op blit_op,
-        DWORD src_usage, enum wined3d_pool src_pool, const struct wined3d_format *src_format, DWORD src_location,
-        DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format, DWORD dst_location)
+static BOOL ffp_blit_supported(enum wined3d_blit_op blit_op, const struct wined3d_context *context,
+        const struct wined3d_resource *src_resource, DWORD src_location,
+        const struct wined3d_resource *dst_resource, DWORD dst_location)
 {
+    const struct wined3d_format *src_format = src_resource->format;
+    const struct wined3d_format *dst_format = dst_resource->format;
     BOOL decompress;
 
     decompress = src_format && (src_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED)
             && !(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_COMPRESSED);
-    if (!decompress && (src_pool == WINED3D_POOL_SYSTEM_MEM || dst_pool == WINED3D_POOL_SYSTEM_MEM))
+    if (!decompress && !(src_resource->access & dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU))
     {
-        TRACE("Source or destination is in system memory.\n");
+        TRACE("Source or destination resource is not GPU accessible.\n");
         return FALSE;
     }
 
@@ -2690,14 +2691,14 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info,
     switch (blit_op)
     {
         case WINED3D_BLIT_OP_COLOR_BLIT_CKEY:
-            if (d3d_info->shader_color_key)
+            if (context->d3d_info->shader_color_key)
             {
                 TRACE("Color keying requires converted textures.\n");
                 return FALSE;
             }
         case WINED3D_BLIT_OP_COLOR_BLIT:
         case WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST:
-            if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
+            if (!context->gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
                 return FALSE;
 
             if (TRACE_ON(d3d))
@@ -2722,7 +2723,7 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info,
                 }
             }
 
-            if (!(dst_usage & WINED3DUSAGE_RENDERTARGET))
+            if (!(dst_resource->usage & WINED3DUSAGE_RENDERTARGET))
             {
                 TRACE("Can only blit to render targets.\n");
                 return FALSE;
@@ -2821,9 +2822,7 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
     dst_resource = &dst_texture->resource;
     device = dst_resource->device;
 
-    if (!ffp_blit_supported(&device->adapter->gl_info, &device->adapter->d3d_info, op,
-            src_resource->usage, src_resource->pool, src_resource->format, src_location,
-            dst_resource->usage, dst_resource->pool, dst_resource->format, dst_location))
+    if (!ffp_blit_supported(op, context, src_resource, src_location, dst_resource, dst_location))
     {
         if ((next = blitter->next))
             return next->ops->blitter_blit(next, op, context, src_surface, src_location,
-- 
2.1.4




More information about the wine-devel mailing list