Matteo Bruni : d3dx9: Skip the AddRef/ Release calls if the new texture is the same as the old one.
Module: wine Branch: master Commit: b3c5d2ccda28b3163cd04baf36e285ff2b1b0057 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b3c5d2ccda28b3163cd04baf36... Author: Matteo Bruni <mbruni(a)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);
participants (1)
-
Alexandre Julliard