[PATCH 3/4] wined3d: allow complex -> complex blits in arbfp blit_shader under special circumstances

Roderick Colenbrander thunderbird2k at gmail.com
Tue May 18 02:30:45 CDT 2010


This patch should also address bug 22575 when using the arbfp backend. A similar fix is needed
for the ffp backend.
---
 dlls/wined3d/arb_program_shader.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index daadcaf..5e62be8 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -6932,7 +6932,7 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum bli
                                  const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool,
                                  const struct wined3d_format_desc *dst_format_desc)
 {
-    enum complex_fixup src_fixup;
+    enum complex_fixup src_fixup, dst_fixup;
 
     if (blit_op != BLIT_OP_BLIT)
     {
@@ -6941,10 +6941,25 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum bli
     }
 
     src_fixup = get_complex_fixup(src_format_desc->color_fixup);
+    dst_fixup = get_complex_fixup(dst_format_desc->color_fixup);
     if (TRACE_ON(d3d_shader) && TRACE_ON(d3d))
     {
-        TRACE("Checking support for fixup:\n");
+        TRACE("Checking support for source fixup:\n");
         dump_color_fixup_desc(src_format_desc->color_fixup);
+        TRACE("Checking support for destination fixup:\n");
+        dump_color_fixup_desc(dst_format_desc->color_fixup);
+    }
+
+    /* In general we don't support any destination fixups except between two complex
+     * surfaces having the same format and when no scaling is needed (except for flipping).
+     */
+    if (src_fixup == dst_fixup && is_complex_fixup(dst_format_desc->color_fixup) && src_rect && dst_rect
+        && (src_rect->right - src_rect->left == dst_rect->right - dst_rect->left)
+        && (abs(src_rect->bottom - src_rect->top) == abs(dst_rect->bottom - dst_rect->top))
+        && (dst_usage & WINED3DUSAGE_RENDERTARGET))
+    {
+        TRACE("[OK]\n");
+        return TRUE;
     }
 
     if (!is_identity_fixup(dst_format_desc->color_fixup))
-- 
1.6.3.3




More information about the wine-patches mailing list