wined3d: Don't load the draw_binding location in surface_unmap() unless the surface is on a swapchain.

It really makes no sense to do this just because a surface happens to be the
current render target. In particular, this patch prevents needlessly bouncing
the surface between the CPU and the GPU when the application does e.g.
multiple colorkeyed blits to the current render target to draw a HUD.
This commit is contained in:
Henri Verbeet 2012-01-20 00:36:26 +01:00 committed by Alexandre Julliard
parent d1254eddb5
commit 8692ff48a9
1 changed files with 7 additions and 1 deletions

View File

@ -953,8 +953,14 @@ static void surface_unmap(struct wined3d_surface *surface)
goto done;
}
/* FIXME: The ORM_BACKBUFFER case probably isn't needed, but who knows
* what obscure bugs in backbuffer ORM removing it will uncover. Also,
* this should only be needed for the frontbuffer, but that requires
* present calls to call surface_load_location() on the backbuffer.
* Fix both of those after 1.4. */
if (surface->container.type == WINED3D_CONTAINER_SWAPCHAIN
|| (device->fb.render_targets && surface == device->fb.render_targets[0]))
|| (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER
&& device->fb.render_targets && surface == device->fb.render_targets[0]))
{
if (!surface->dirtyRect.left && !surface->dirtyRect.top
&& surface->dirtyRect.right == surface->resource.width