=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: wined3d: Call arbfp_blit_surface and ffp_blit_blit_surface through the blit interfaces.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 15 08:43:26 CDT 2015


Module: wine
Branch: master
Commit: 27209c69a90bce2acd80937bd5bae0da0e9a01d5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=27209c69a90bce2acd80937bd5bae0da0e9a01d5

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue Apr 14 11:16:26 2015 +0200

wined3d: Call arbfp_blit_surface and ffp_blit_blit_surface through the blit interfaces.

---

 dlls/wined3d/arb_program_shader.c |  5 ++---
 dlls/wined3d/surface.c            | 32 +++++++++++++++++---------------
 dlls/wined3d/wined3d_private.h    | 10 ++++------
 3 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index ef7f6ff..797c204 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7870,7 +7870,7 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info,
     }
 }
 
-HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
+static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
         struct wined3d_surface *src_surface, const RECT *src_rect_in,
         struct wined3d_surface *dst_surface, const RECT *dst_rect_in,
         const struct wined3d_color_key *color_key)
@@ -7923,8 +7923,6 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
 
     surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
     surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
-
-    return WINED3D_OK;
 }
 
 static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface,
@@ -7949,4 +7947,5 @@ const struct blit_shader arbfp_blit = {
     arbfp_blit_supported,
     arbfp_blit_color_fill,
     arbfp_blit_depth_fill,
+    arbfp_blit_surface,
 };
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 54a632d..2838004 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4409,6 +4409,7 @@ const struct blit_shader ffp_blit =  {
     ffp_blit_supported,
     ffp_blit_color_fill,
     ffp_blit_depth_fill,
+    ffp_blit_blit_surface,
 };
 
 static HRESULT cpu_blit_alloc(struct wined3d_device *device)
@@ -5046,6 +5047,15 @@ static HRESULT cpu_blit_depth_fill(struct wined3d_device *device,
     return WINED3DERR_INVALIDCALL;
 }
 
+static void cpu_blit_blit_surface(struct wined3d_device *device, DWORD filter,
+        struct wined3d_surface *src_surface, const RECT *src_rect,
+        struct wined3d_surface *dst_surface, const RECT *dst_rect,
+        const struct wined3d_color_key *color_key)
+{
+    /* FIXME: Remove error returns from surface_blt_cpu. */
+    ERR("Blit method not implemented by cpu_blit.\n");
+}
+
 const struct blit_shader cpu_blit =  {
     cpu_blit_alloc,
     cpu_blit_free,
@@ -5054,6 +5064,7 @@ const struct blit_shader cpu_blit =  {
     cpu_blit_supported,
     cpu_blit_color_fill,
     cpu_blit_depth_fill,
+    cpu_blit_blit_surface,
 };
 
 HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in,
@@ -5253,6 +5264,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
     }
     else
     {
+        const struct blit_shader *blitter;
+
         /* In principle this would apply to depth blits as well, but we don't
          * implement those in the CPU blitter at the moment. */
         if ((dst_surface->locations & dst_surface->resource.map_binding)
@@ -5354,23 +5367,12 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
                 return WINED3D_OK;
             }
 
-            if (arbfp_blit.blit_supported(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
+            blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
                     &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format,
-                    &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format))
-            {
-                TRACE("Using arbfp blit.\n");
-
-                if (SUCCEEDED(arbfp_blit_surface(device, filter, src_surface, &src_rect,
-                        dst_surface, &dst_rect, color_key)))
-                    return WINED3D_OK;
-            }
-
-            if (ffp_blit.blit_supported(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
-                    &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format,
-                    &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format))
+                    &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format);
+            if (blitter)
             {
-                TRACE("Using FFP blit.\n");
-                ffp_blit_blit_surface(device, filter, src_surface, &src_rect, dst_surface, &dst_rect, color_key);
+                blitter->blit_surface(device, filter, src_surface, &src_rect, dst_surface, &dst_rect, color_key);
                 return WINED3D_OK;
             }
         }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index df74268..acac299 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1351,6 +1351,10 @@ struct blit_shader
             const RECT *dst_rect, const struct wined3d_color *color);
     HRESULT (*depth_fill)(struct wined3d_device *device,
             struct wined3d_surface *surface, const RECT *rect, float depth);
+    void (*blit_surface)(struct wined3d_device *device, DWORD filter,
+            struct wined3d_surface *src_surface, const RECT *src_rect,
+            struct wined3d_surface *dst_surface, const RECT *dst_rect,
+            const struct wined3d_color_key *color_key);
 };
 
 extern const struct blit_shader ffp_blit DECLSPEC_HIDDEN;
@@ -1363,12 +1367,6 @@ const struct blit_shader *wined3d_select_blitter(const struct wined3d_gl_info *g
         const RECT *dst_rect, DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format)
         DECLSPEC_HIDDEN;
 
-/* Temporary blit_shader helper functions */
-HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
-        struct wined3d_surface *src_surface, const RECT *src_rect,
-        struct wined3d_surface *dst_surface, const RECT *dst_rect,
-        const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
-
 struct wined3d_context *context_acquire(const struct wined3d_device *device,
         struct wined3d_surface *target) DECLSPEC_HIDDEN;
 void context_alloc_event_query(struct wined3d_context *context,




More information about the wine-cvs mailing list