Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 9 ++++++--- dlls/d3d10/tests/effect.c | 1 - 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 19befb64b0f..71bc8161c76 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3205,14 +3205,14 @@ static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetCon static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface, const char *name) { - struct d3d10_effect *This = impl_from_ID3D10Effect(iface); + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); unsigned int i;
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
- for (i = 0; i < This->local_buffer_count; ++i) + for (i = 0; i < effect->local_buffer_count; ++i) { - struct d3d10_effect_variable *l = &This->local_buffers[i]; + struct d3d10_effect_variable *l = &effect->local_buffers[i];
if (l->name && !strcmp(l->name, name)) { @@ -3221,6 +3221,9 @@ static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetCon } }
+ if (effect->pool) + return effect->pool->lpVtbl->GetConstantBufferByName(effect->pool, name); + WARN("Invalid name specified\n");
return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index d2761462c6d..9daf3faf8d0 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6543,7 +6543,6 @@ todo_wine { ID3D10Device_Release(device3);
cb = child_effect->lpVtbl->GetConstantBufferByName(child_effect, "s_cb"); -todo_wine ok(cb->lpVtbl->IsValid(cb), "Expected valid constant buffer.\n");
hr = cb->lpVtbl->GetConstantBuffer(cb, &buffer);