Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/ddraw/surface.c | 12 ++++++++++-- dlls/wined3d/cs.c | 2 ++ include/wine/wined3d.h | 1 + 3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index fc120e390eb..d201d9d4146 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -1458,24 +1458,32 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT *
if (flags & DDBLT_COLORFILL) { + wined3d_flags = WINED3DCLEAR_TARGET; + if (!(flags & DDBLT_ASYNC)) + wined3d_flags |= WINED3DCLEAR_SYNCHRONOUS; + if (!wined3d_colour_from_ddraw_colour(&dst_surface->surface_desc.u4.ddpfPixelFormat, dst_surface->palette, fill_colour, &colour)) return DDERR_INVALIDPARAMS;
return wined3d_device_clear_rendertarget_view(wined3d_device, ddraw_surface_get_rendertarget_view(dst_surface), - dst_rect, WINED3DCLEAR_TARGET, &colour, 0.0f, 0); + dst_rect, wined3d_flags, &colour, 0.0f, 0); }
if (flags & DDBLT_DEPTHFILL) { + wined3d_flags = WINED3DCLEAR_ZBUFFER; + if (!(flags & DDBLT_ASYNC)) + wined3d_flags |= WINED3DCLEAR_SYNCHRONOUS; + if (!wined3d_colour_from_ddraw_colour(&dst_surface->surface_desc.u4.ddpfPixelFormat, dst_surface->palette, fill_colour, &colour)) return DDERR_INVALIDPARAMS;
return wined3d_device_clear_rendertarget_view(wined3d_device, ddraw_surface_get_rendertarget_view(dst_surface), - dst_rect, WINED3DCLEAR_ZBUFFER, NULL, colour.r, 0); + dst_rect, wined3d_flags, NULL, colour.r, 0); }
wined3d_flags = flags & ~DDBLT_ASYNC; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index ecfce418123..ff4d562f106 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -671,6 +671,8 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined wined3d_resource_acquire(view->resource);
cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT); + if (flags & WINED3DCLEAR_SYNCHRONOUS) + cs->ops->finish(cs, WINED3D_CS_QUEUE_DEFAULT); }
static void acquire_shader_resources(const struct wined3d_state *state, unsigned int shader_mask) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index dc613fff2b2..e2e6a72c846 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1015,6 +1015,7 @@ enum wined3d_shader_type #define WINED3DCLEAR_TARGET 0x00000001 #define WINED3DCLEAR_ZBUFFER 0x00000002 #define WINED3DCLEAR_STENCIL 0x00000004 +#define WINED3DCLEAR_SYNCHRONOUS 0x80000000
/* Stream source flags */ #define WINED3DSTREAMSOURCE_INDEXEDDATA (1u << 30)