Henri Verbeet : wined3d: Implement depth fills in the CPU blitter.

Alexandre Julliard julliard at winehq.org
Fri Feb 24 14:48:09 CST 2017


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Feb 24 08:10:32 2017 +0100

wined3d: Implement depth fills in the CPU blitter.

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/surface.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1ac2e5f..51200d2 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2975,10 +2975,8 @@ static BOOL cpu_blit_supported(const struct wined3d_gl_info *gl_info,
         const RECT *src_rect, DWORD src_usage, enum wined3d_pool src_pool, const struct wined3d_format *src_format,
         const RECT *dst_rect, DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format)
 {
-    if (blit_op == WINED3D_BLIT_OP_COLOR_FILL)
-    {
+    if (blit_op == WINED3D_BLIT_OP_COLOR_FILL || blit_op == WINED3D_BLIT_OP_DEPTH_FILL)
         return TRUE;
-    }
 
     return FALSE;
 }
@@ -3208,15 +3206,12 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int
     }
 
     /* First, all the 'source-less' blits */
-    if (flags & WINED3D_BLT_COLOR_FILL)
+    if (flags & (WINED3D_BLT_COLOR_FILL | WINED3D_BLT_DEPTH_FILL))
     {
         hr = _Blt_ColorFill(dbuf, dst_width, dst_height, bpp, dst_map.row_pitch, fx->fill_color);
-        flags &= ~WINED3D_BLT_COLOR_FILL;
+        flags &= ~(WINED3D_BLT_COLOR_FILL | WINED3D_BLT_DEPTH_FILL);
     }
 
-    if (flags & WINED3D_BLT_DEPTH_FILL)
-        FIXME("WINED3D_BLT_DEPTH_FILL needs to be implemented!\n");
-
     /* Now the 'with source' blits. */
     if (src_texture)
     {
@@ -3587,8 +3582,20 @@ static HRESULT cpu_blit_depth_fill(struct wined3d_device *device,
         struct wined3d_rendertarget_view *view,  const RECT *rect, DWORD clear_flags,
         float depth, DWORD stencil)
 {
-    FIXME("Depth/stencil filling not implemented by cpu_blit.\n");
-    return WINED3DERR_INVALIDCALL;
+    const struct wined3d_box box = {rect->left, rect->top, rect->right, rect->bottom, 0, 1};
+    struct wined3d_color color = {depth, 0.0f, 0.0f, 0.0f};
+    static const struct wined3d_box src_box;
+    struct wined3d_blt_fx fx;
+
+    if (clear_flags != WINED3DCLEAR_ZBUFFER)
+    {
+        FIXME("clear_flags %#x not implemented.\n", clear_flags);
+        return WINED3DERR_INVALIDCALL;
+    }
+
+    fx.fill_color = wined3d_format_convert_from_float(view->format, &color);
+    return surface_cpu_blt(texture_from_resource(view->resource), view->sub_resource_idx,
+            &box, NULL, 0, &src_box, WINED3D_BLT_DEPTH_FILL, &fx, WINED3D_TEXF_POINT);
 }
 
 static void cpu_blit_blit_surface(struct wined3d_device *device, enum wined3d_blit_op op, DWORD filter,




More information about the wine-cvs mailing list