Matteo Bruni : d3dx9: Skip the AddRef/ Release calls if the new texture is the same as the old one.

Alexandre Julliard julliard at winehq.org
Thu Apr 17 13:43:25 CDT 2014


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

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Wed Apr 16 18:14:50 2014 +0200

d3dx9: Skip the AddRef/Release calls if the new texture is the same as the old one.

---

 dlls/d3dx9_36/effect.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index a2a8e9f..8e2f850 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -2409,6 +2409,9 @@ static HRESULT d3dx9_base_effect_set_texture(struct d3dx9_base_effect *base,
     {
         struct IDirect3DBaseTexture9 *oltexture = *(struct IDirect3DBaseTexture9 **)param->data;
 
+        if (texture == oltexture)
+            return D3D_OK;
+
         if (texture) IDirect3DBaseTexture9_AddRef(texture);
         if (oltexture) IDirect3DBaseTexture9_Release(oltexture);
 




More information about the wine-cvs mailing list