Module: wine Branch: master Commit: 3ae4be8696f6abeb2a83b6265d1e6b2127b6922d URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ae4be8696f6abeb2a83b6265d...
Author: Józef Kucia jkucia@codeweavers.com Date: Tue Mar 15 10:52:49 2016 +0100
wined3d: Implement stencil clear in wined3d_device_clear_rendertarget_view().
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/arb_program_shader.c | 4 ++-- dlls/wined3d/device.c | 8 +------- dlls/wined3d/surface.c | 12 +++++++----- dlls/wined3d/wined3d_private.h | 4 ++-- 4 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index cdd6167..7c4c1db 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -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; }
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index be8d36f..37d9ee9 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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, diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index f7ca370..dcc946c 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -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; }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ec7de5a..23d8565 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -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,