[PATCH 10/10] wined3d: Add BLT_OP_COLOR_FILL to blit_supported and use it in BltOverride.

Roderick Colenbrander thunderbird2k at gmail.com
Mon Apr 12 05:44:45 CDT 2010


---
 dlls/wined3d/surface.c         |   30 ++++++++++++++++++++++--------
 dlls/wined3d/wined3d_private.h |    3 ++-
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 9ac428b..0dbfbed 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3756,16 +3756,14 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
                 return WINED3DERR_INVALIDCALL;
             }
 
-            /* This == (IWineD3DSurfaceImpl *) myDevice->render_targets[0] || dstSwapchain
-                must be true if we are here */
-            if (This != (IWineD3DSurfaceImpl *) myDevice->render_targets[0] &&
-                    !(This == (IWineD3DSurfaceImpl*) dstSwapchain->frontBuffer ||
-                      (dstSwapchain->backBuffer && This == (IWineD3DSurfaceImpl*) dstSwapchain->backBuffer[0]))) {
-                TRACE("Surface is higher back buffer, falling back to software\n");
-                return cpu_blit.color_fill(myDevice, This, &dst_rect, color);
+            if (ffp_blit.blit_supported(&myDevice->adapter->gl_info, BLIT_OP_COLOR_FILL,
+                                        NULL, 0, 0, NULL,
+                                        &dst_rect, This->resource.usage, This->resource.pool, This->resource.format_desc))
+            {
+                return ffp_blit.color_fill(myDevice, This, &dst_rect, color);
             }
 
-            return ffp_blit.color_fill(myDevice, This, &dst_rect, color);
+            return cpu_blit.color_fill(myDevice, This, &dst_rect, color);
         }
     }
 
@@ -4801,6 +4799,17 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_
         dump_color_fixup_desc(src_format_desc->color_fixup);
     }
 
+    if (blit_op == BLIT_OP_COLOR_FILL)
+    {
+        if (!(dst_usage & WINED3DUSAGE_RENDERTARGET))
+        {
+            TRACE("Color fill not supported\n");
+            return FALSE;
+        }
+
+        return TRUE;
+    }
+
     if (blit_op != BLIT_OP_BLIT)
     {
         TRACE("Unsupported blit_op=%d\n", blit_op);
@@ -4872,6 +4881,11 @@ static BOOL cpu_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_
                                const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool,
                                const struct wined3d_format_desc *dst_format_desc)
 {
+    if (blit_op == BLIT_OP_COLOR_FILL)
+    {
+        return TRUE;
+    }
+
     return FALSE;
 }
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 09e1b81..9d69c8b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1170,7 +1170,8 @@ HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_
 
 enum blit_operation
 {
-    BLIT_OP_BLIT
+    BLIT_OP_BLIT,
+    BLIT_OP_COLOR_FILL
 };
 
 /* Shaders for color conversions in blits */
-- 
1.6.3.3




More information about the wine-patches mailing list