[PATCH] WineD3D: Use CTXUSAGE_RESOURCELOAD for fb->texture reads=0A=

Stefan Doesinger stefan at codeweavers.com
Tue Jun 17 01:41:02 CDT 2008


=0A=
There is no need for _BLIT usage. RESOURCELOAD should be faster=0A=
---=0A=
 dlls/wined3d/surface.c |    9 ++++-----=0A=
 1 files changed, 4 insertions(+), 5 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c=0A=
index 48e13fe..a834002 100644=0A=
--- a/dlls/wined3d/surface.c=0A=
+++ b/dlls/wined3d/surface.c=0A=
@@ -886,12 +886,11 @@ static void =
read_from_framebuffer_texture(IWineD3DSurfaceImpl *This)=0A=
     d3dfmt_get_conv(This, TRUE /* We need color keying */, TRUE /* We =
will use textures */, &format, &internal, &type, &convert, &bpp, =
This->srgb);=0A=
 =0A=
     IWineD3DSurface_GetContainer((IWineD3DSurface *) This, =
&IID_IWineD3DSwapChain, (void **)&swapchain);=0A=
-    /* Activate the surface. Set it up for blitting now, although not =
necessarily needed for LockRect.=0A=
-     * Certain graphics drivers seem to dislike some enabled states =
when reading from opengl, the blitting usage=0A=
-     * should help here. Furthermore unlockrect will need the context =
set up for blitting. The context manager will find=0A=
-     * context->last_was_blit set on the unlock.=0A=
+    /* Activate the surface to read from. In some situations it isn't =
the currently active target(e.g. backbuffer=0A=
+     * locking during offscreen rendering). RESOURCELOAD is ok because =
glCopyTexSubImage2D isn't affected by any=0A=
+     * states in the stateblock, and no driver was found yet that had =
bugs in that regard.=0A=
      */=0A=
-    ActivateContext(device, (IWineD3DSurface *) This, CTXUSAGE_BLIT);=0A=
+    ActivateContext(device, (IWineD3DSurface *) This, =
CTXUSAGE_RESOURCELOAD);=0A=
     surface_bind_and_dirtify(This);=0A=
     ENTER_GL();=0A=
 =0A=
-- =0A=
1.5.4.5=0A=
=0A=

------=_NextPart_000_0002_01C8DB84.8FD5D220--




More information about the wine-patches mailing list