Commit 3ae4be86 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Implement stencil clear in wined3d_device_clear_rendertarget_view().

parent c21dbb51
......@@ -7931,9 +7931,9 @@ static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined
}
static HRESULT arbfp_blit_depth_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view,
const RECT *rect, float depth)
const RECT *rect, DWORD clear_flags, float depth, DWORD stencil)
{
FIXME("Depth filling not implemented by arbfp_blit.\n");
FIXME("Depth/stencil filling not implemented by arbfp_blit.\n");
return WINED3DERR_INVALIDCALL;
}
......
......@@ -4092,12 +4092,6 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
if (!flags)
return WINED3D_OK;
if (flags & WINED3DCLEAR_STENCIL)
{
FIXME("Stencil clear not implemented.\n");
return E_NOTIMPL;
}
resource = view->resource;
if (resource->type != WINED3D_RTYPE_TEXTURE_2D)
{
......@@ -4132,7 +4126,7 @@ HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *devi
if (blit_op == WINED3D_BLIT_OP_COLOR_FILL)
return blitter->color_fill(device, view, rect, color);
else
return blitter->depth_fill(device, view, rect, depth);
return blitter->depth_fill(device, view, rect, flags, depth, stencil);
}
struct wined3d_rendertarget_view * CDECL wined3d_device_get_rendertarget_view(const struct wined3d_device *device,
......
......@@ -927,7 +927,7 @@ static HRESULT wined3d_surface_depth_fill(struct wined3d_surface *surface, const
return hr;
}
hr = blitter->depth_fill(device, view, rect, depth);
hr = blitter->depth_fill(device, view, rect, WINED3DCLEAR_ZBUFFER, depth, 0);
wined3d_rendertarget_view_decref(view);
return hr;
......@@ -3584,12 +3584,13 @@ static HRESULT ffp_blit_color_fill(struct wined3d_device *device, struct wined3d
}
static HRESULT ffp_blit_depth_fill(struct wined3d_device *device,
struct wined3d_rendertarget_view *view, const RECT *rect, float depth)
struct wined3d_rendertarget_view *view, const RECT *rect, DWORD clear_flags,
float depth, DWORD stencil)
{
const RECT draw_rect = {0, 0, view->width, view->height};
struct wined3d_fb_state fb = {NULL, view};
device_clear_render_targets(device, 0, &fb, 1, rect, &draw_rect, WINED3DCLEAR_ZBUFFER, 0, depth, 0);
device_clear_render_targets(device, 0, &fb, 1, rect, &draw_rect, clear_flags, NULL, depth, stencil);
return WINED3D_OK;
}
......@@ -4279,9 +4280,10 @@ static HRESULT cpu_blit_color_fill(struct wined3d_device *device, struct wined3d
}
static HRESULT cpu_blit_depth_fill(struct wined3d_device *device,
struct wined3d_rendertarget_view *view, const RECT *rect, float depth)
struct wined3d_rendertarget_view *view, const RECT *rect, DWORD clear_flags,
float depth, DWORD stencil)
{
FIXME("Depth filling not implemented by cpu_blit.\n");
FIXME("Depth/stencil filling not implemented by cpu_blit.\n");
return WINED3DERR_INVALIDCALL;
}
......
......@@ -1473,8 +1473,8 @@ struct blit_shader
const RECT *dst_rect, DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format);
HRESULT (*color_fill)(struct wined3d_device *device, struct wined3d_rendertarget_view *view,
const RECT *rect, const struct wined3d_color *color);
HRESULT (*depth_fill)(struct wined3d_device *device,
struct wined3d_rendertarget_view *view, const RECT *rect, float depth);
HRESULT (*depth_fill)(struct wined3d_device *device, struct wined3d_rendertarget_view *view,
const RECT *rect, DWORD clear_flags, float depth, DWORD stencil);
void (*blit_surface)(struct wined3d_device *device, enum wined3d_blit_op op, DWORD filter,
struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const RECT *dst_rect,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment