wined3d: Implement depth fills in the CPU blitter.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-02-24 08:10:32 +01:00 committed by Alexandre Julliard
parent e3f55717e2
commit f0b6873734
1 changed files with 17 additions and 10 deletions

View File

@ -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,