diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 2ae8bd2b509..ef8fb868c63 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -469,17 +469,21 @@ static struct d3dx_technique *get_technique_by_name(struct ID3DXBaseEffectImpl * static struct d3dx_technique *is_valid_technique(struct ID3DXBaseEffectImpl *base, D3DXHANDLE technique) { + struct d3dx_technique *tech = NULL; unsigned int i; for (i = 0; i < base->technique_count; ++i) { if (base->technique_handles[i] == technique) { - return get_technique_struct(technique); + tech = get_technique_struct(technique); + break; } } - return NULL; + if (!tech) tech = get_technique_by_name(base, technique); + + return tech; } static struct d3dx_pass *is_valid_pass(struct ID3DXBaseEffectImpl *base, D3DXHANDLE pass) @@ -1462,8 +1466,6 @@ static D3DXHANDLE WINAPI ID3DXBaseEffectImpl_GetPass(ID3DXBaseEffect *iface, D3D TRACE("iface %p, technique %p, index %u\n", This, technique, index); - if (!tech) tech = get_technique_struct(iface->lpVtbl->GetTechniqueByName(iface, technique)); - if (tech && index < tech->pass_count) { TRACE("Returning pass %p\n", tech->pass_handles[index]); @@ -1482,8 +1484,6 @@ static D3DXHANDLE WINAPI ID3DXBaseEffectImpl_GetPassByName(ID3DXBaseEffect *ifac TRACE("iface %p, technique %p, name %s\n", This, technique, debugstr_a(name)); - if (!tech) tech = get_technique_struct(iface->lpVtbl->GetTechniqueByName(iface, technique)); - if (tech && name) { unsigned int i; @@ -3525,8 +3525,6 @@ static HRESULT WINAPI ID3DXEffectImpl_SetTechnique(ID3DXEffect *iface, D3DXHANDL TRACE("iface %p, technique %p\n", This, technique); - if (!tech) tech = get_technique_struct(iface->lpVtbl->GetTechniqueByName(iface, technique)); - if (tech) { UINT i;