Stefan Dösinger : wined3d: Inform the texture about filtering changes.

Alexandre Julliard julliard at winehq.org
Wed Nov 28 08:01:41 CST 2007


Module: wine
Branch: master
Commit: b91c19af874f8d2a340995d26dfa8e4b8bb0290f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b91c19af874f8d2a340995d26dfa8e4b8bb0290f

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue Nov 27 23:43:11 2007 +0100

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 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index df617dd..34a32c2 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();
 }




More information about the wine-cvs mailing list