Module: wine
Branch: master
Commit: 8692ff48a953f368860967c1141ec875adba9aaf
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8692ff48a953f368860967c11…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Fri Jan 20 00:36:26 2012 +0100
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 …
[View More]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.
---
dlls/wined3d/surface.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 7aa68d1..21bd088 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -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
[View Less]