Commit 8692ff48 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Don't load the draw_binding location in surface_unmap() unless the…

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.
parent d1254edd
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment