Module: wine
Branch: master
Commit: d0f1c23c936244ae779eb13035b2f217039dfe20
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d0f1c23c936244ae779eb1303…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at>
Date: Tue Jan 2 22:55:31 2007 +0100
wined3d: Select a proper texture unit in LockRect and dirtify the state.
---
dlls/wined3d/surface.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 4e1a0d6..e7991f6 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -633,8 +633,15 @@ static HRESULT WINAPI IWineD3DSurfaceImp
This->Flags |= SFLAG_ACTIVELOCK; /* When this flag is set to true, loading the surface again won't free THis->resource.allocatedMemory */
/* TODO: make activeLock a bit more intelligent, maybe implement a method to purge the texture memory. */
- /* Make sure that the texture is loaded */
- IWineD3DSurface_PreLoad(iface); /* Make sure there is a texture to bind! */
+ /* Make sure that a proper texture unit is selected, bind the texture and dirtify the sampler to restore the texture on the next draw */
+ if (GL_SUPPORT(ARB_MULTITEXTURE)) {
+ ENTER_GL();
+ GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB));
+ checkGLcall("glActiveTextureARB");
+ LEAVE_GL();
+ }
+ IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(0));
+ IWineD3DSurface_PreLoad(iface);
surface_download_data(This);
}