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

This commit is contained in:
Matteo Bruni 2014-04-16 18:14:50 +02:00 committed by Alexandre Julliard
parent 96b0b91752
commit b3c5d2ccda
1 changed files with 3 additions and 0 deletions
dlls/d3dx9_36

View File

@ -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);