[PATCH 4/5] wined3d: Implement depth fills in the CPU blitter.
Henri Verbeet
hverbeet at codeweavers.com
Fri Feb 24 01:10:32 CST 2017
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
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,
--
2.1.4
More information about the wine-patches
mailing list