[PATCH 4/4] wined3d: add BLIT_OP_COMPLEX_UPLOAD

Roderick Colenbrander thunderbird2k at gmail.com
Mon May 17 06:11:41 CDT 2010


This patch introduces a new blit operation to allow complex uploads from LoadLocation. It allows hw accelerated
p8 uploads to function again (I broke them by accident). Without this blit_operation there is no way to detect
this single case at the moment in which we allow the P8 shader (remember both the source and destination have
complex fixups set, so this doesn't pass).
---
 dlls/wined3d/arb_program_shader.c |   22 ++++++++++++++--------
 dlls/wined3d/surface.c            |   16 +++++++++-------
 dlls/wined3d/wined3d_private.h    |    3 ++-
 3 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index f62ff56..b422c6c 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -6932,21 +6932,27 @@ 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 = get_complex_fixup(src_format_desc->color_fixup);
 
-    if (blit_op != BLIT_OP_BLIT)
-    {
-        TRACE("Unsupported blit_op=%d\n", blit_op);
-        return FALSE;
-    }
-
-    src_fixup = get_complex_fixup(src_format_desc->color_fixup);
     if (TRACE_ON(d3d_shader) && TRACE_ON(d3d))
     {
         TRACE("Checking support for fixup:\n");
         dump_color_fixup_desc(src_format_desc->color_fixup);
     }
 
+    if (blit_op == BLIT_OP_COMPLEX_UPLOAD &&
+        src_fixup == COMPLEX_FIXUP_P8)
+    {
+        TRACE("P8 fixup supported\n");
+        return TRUE;
+    }
+
+    if (blit_op != BLIT_OP_BLIT)
+    {
+        TRACE("Unsupported blit_op=%d\n", blit_op);
+        return FALSE;
+    }
+
     if (!is_identity_fixup(dst_format_desc->color_fixup))
     {
         TRACE("Destination fixups are not supported\n");
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 193260e..4b989d6 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2162,7 +2162,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
                 Paletted Texture
                 **************** */
 
-            blit_supported = device->blitter->blit_supported(&device->adapter->gl_info, BLIT_OP_BLIT,
+            blit_supported = device->blitter->blit_supported(&device->adapter->gl_info, BLIT_OP_COMPLEX_UPLOAD,
                                                              &rect, This->resource.usage, This->resource.pool,
                                                              This->resource.format_desc, &rect, This->resource.usage,
                                                              This->resource.pool, This->resource.format_desc);
@@ -4832,6 +4832,14 @@ 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_COMPLEX_UPLOAD &&
+        src_fixup == COMPLEX_FIXUP_P8 &&
+        gl_info->supported[EXT_PALETTED_TEXTURE])
+    {
+        TRACE("P8 fixup supported\n");
+        return TRUE;
+    }
+
     if (blit_op != BLIT_OP_BLIT)
     {
         TRACE("Unsupported blit_op=%d\n", blit_op);
@@ -4844,12 +4852,6 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_
         return FALSE;
     }
 
-    if (src_fixup == COMPLEX_FIXUP_P8 && gl_info->supported[EXT_PALETTED_TEXTURE])
-    {
-        TRACE("P8 fixup supported\n");
-        return TRUE;
-    }
-
     /* We only support identity conversions. */
     if (is_identity_fixup(src_format_desc->color_fixup))
     {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8443303..961033d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1161,7 +1161,8 @@ HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_
 enum blit_operation
 {
     BLIT_OP_BLIT,
-    BLIT_OP_COLOR_FILL
+    BLIT_OP_COLOR_FILL,
+    BLIT_OP_COMPLEX_UPLOAD
 };
 
 /* Shaders for color conversions in blits */
-- 
1.6.3.3




More information about the wine-patches mailing list