ddraw: Only do asynchronous clears when the application asked for them.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-09-27 19:00:34 +03:30 committed by Alexandre Julliard
parent a6d640e866
commit fbcdf8c698
3 changed files with 13 additions and 2 deletions

View File

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

View File

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

View File

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