wined3d: Don't flush just because a swapchain has multiple contexts.

If you really have e.g. multiple draws to the same drawable, this is not
enough, and you should use the StrictDrawOrdering registry setting. In the
other cases it just slows things down unnecessarily.
This commit is contained in:
Henri Verbeet 2011-04-14 22:41:49 +02:00 committed by Alexandre Julliard
parent 89a4e696a2
commit 66875c6dc7
2 changed files with 6 additions and 12 deletions

View file

@ -7206,7 +7206,6 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
IWineD3DSurfaceImpl *dst_surface, const RECT *dst_rect_in, enum wined3d_blit_op blit_op,
DWORD Filter)
{
struct wined3d_swapchain *dst_swapchain;
struct wined3d_context *context;
RECT dst_rect = *dst_rect_in;
@ -7232,11 +7231,9 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
/* Leave the opengl state valid for blitting */
arbfp_blit_unset(context->gl_info);
dst_swapchain = dst_surface->container.type == WINED3D_CONTAINER_SWAPCHAIN
? dst_surface->container.u.swapchain : NULL;
if (wined3d_settings.strict_draw_ordering || (dst_swapchain
&& (dst_surface == dst_swapchain->front_buffer
|| dst_swapchain->num_contexts > 1)))
if (wined3d_settings.strict_draw_ordering
|| (dst_surface->container.type == WINED3D_CONTAINER_SWAPCHAIN
&& (dst_surface->container.u.swapchain->front_buffer == dst_surface)))
wglFlush(); /* Flush to ensure ordering across contexts. */
context_release(context);

View file

@ -3568,16 +3568,12 @@ static void surface_blt_to_drawable(IWineD3DDeviceImpl *device,
IWineD3DSurfaceImpl *src_surface, const RECT *src_rect_in,
IWineD3DSurfaceImpl *dst_surface, const RECT *dst_rect_in)
{
struct wined3d_swapchain *swapchain = NULL;
struct wined3d_context *context;
RECT src_rect, dst_rect;
src_rect = *src_rect_in;
dst_rect = *dst_rect_in;
if (dst_surface->container.type == WINED3D_CONTAINER_SWAPCHAIN)
swapchain = dst_surface->container.u.swapchain;
/* Make sure the surface is up-to-date. This should probably use
* surface_load_location() and worry about the destination surface too,
* unless we're overwriting it completely. */
@ -3628,8 +3624,9 @@ static void surface_blt_to_drawable(IWineD3DDeviceImpl *device,
/* Leave the opengl state valid for blitting */
device->blitter->unset_shader(context->gl_info);
if (wined3d_settings.strict_draw_ordering || (swapchain
&& (dst_surface == swapchain->front_buffer || swapchain->num_contexts > 1)))
if (wined3d_settings.strict_draw_ordering
|| (dst_surface->container.type == WINED3D_CONTAINER_SWAPCHAIN
&& (dst_surface->container.u.swapchain->front_buffer == dst_surface)))
wglFlush(); /* Flush to ensure ordering across contexts. */
context_release(context);