Module: wine Branch: master Commit: 99981f260479cb72a414181bc2e97038fe5eeb42 URL: http://source.winehq.org/git/wine.git/?a=commit;h=99981f260479cb72a414181bc2...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Sep 17 14:50:49 2008 +0200
wined3d: Remove some assumptions that PreLoad() will always bind the texture.
---
dlls/wined3d/basetexture.c | 2 +- dlls/wined3d/device.c | 1 + dlls/wined3d/state.c | 1 + dlls/wined3d/surface.c | 1 + 4 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index 26940f4..ffc01e8 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -389,7 +389,7 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface GLint textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface); BOOL cond_np2 = IWineD3DBaseTexture_IsCondNP2(iface);
- IWineD3DBaseTexture_PreLoad(iface); + /* ApplyStateChanges relies on the correct texture being bound and loaded. */
if(samplerStates[WINED3DSAMP_ADDRESSU] != This->baseTexture.states[WINED3DTEXSTA_ADDRESSU]) { state = samplerStates[WINED3DSAMP_ADDRESSU]; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 9e0cf4f..1c05dc9 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5875,6 +5875,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
/* Make sure the surface is loaded and up to date */ IWineD3DSurface_PreLoad(pDestinationSurface); + IWineD3DSurface_BindTexture(pDestinationSurface);
IWineD3DSurface_GetGlDesc(pDestinationSurface, &glDescription);
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 358ad14..355996b 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3487,6 +3487,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
if(stateblock->textures[sampler]) { IWineD3DBaseTexture_PreLoad(stateblock->textures[sampler]); + IWineD3DBaseTexture_BindTexture(stateblock->textures[sampler]); IWineD3DBaseTexture_ApplyStateChanges(stateblock->textures[sampler], stateblock->textureState[sampler], stateblock->samplerState[sampler]);
if (GL_SUPPORT(EXT_TEXTURE_LOD_BIAS)) { diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 49e5c12..7b522f8 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2452,6 +2452,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const ch
} else { /* bind the real texture, and make sure it up to date */ IWineD3DSurface_PreLoad(iface); + surface_bind_and_dirtify(This); } allocatedMemory = HeapAlloc(GetProcessHeap(), 0, width * height * 4); ENTER_GL();