From b91c19af874f8d2a340995d26dfa8e4b8bb0290f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 27 Nov 2007 23:43:11 +0100 Subject: [PATCH] wined3d: Inform the texture about filtering changes. The surface_blt_to_drawable function changes the filtering settings of the texture object, but without informing the container about this change. This patch makes sure that the basetexture knows about this and reapplies the changed states to the settings chosen by the app. --- dlls/wined3d/surface.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index df617dd1f45..34a32c29e38 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3510,6 +3510,7 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT struct coords coords[4]; RECT rect; IWineD3DSwapChain *swapchain = NULL; + IWineD3DBaseTexture *texture = NULL; HRESULT hr; IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; @@ -3640,6 +3641,17 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT glFlush(); IWineD3DSwapChain_Release(swapchain); + } else { + /* We changed the filtering settings on the texture. Inform the container about this to get the filters + * reset properly next draw + */ + hr = IWineD3DSurface_GetContainer((IWineD3DSurface*)This, &IID_IWineD3DBaseTexture, (void **) &texture); + if(hr == WINED3D_OK && texture) { + ((IWineD3DBaseTextureImpl *) texture)->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT; + ((IWineD3DBaseTextureImpl *) texture)->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; + ((IWineD3DBaseTextureImpl *) texture)->baseTexture.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE; + IWineD3DBaseTexture_Release(texture); + } } LEAVE_GL(); }