d3d10/effect: Forward to pool effect in GetConstantBufferByIndex().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-09-21 08:22:18 +03:00 committed by Alexandre Julliard
parent 19517f8685
commit fab2d7d8a3
2 changed files with 15 additions and 14 deletions

View File

@ -3179,22 +3179,27 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10
static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface,
UINT index)
{
struct d3d10_effect *This = impl_from_ID3D10Effect(iface);
struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
struct d3d10_effect_variable *l;
TRACE("iface %p, index %u\n", iface, index);
if (index >= This->local_buffer_count)
if (index < effect->local_buffer_count)
{
WARN("Invalid index specified\n");
return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface;
l = &effect->local_buffers[index];
TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name));
return (ID3D10EffectConstantBuffer *)&l->ID3D10EffectVariable_iface;
}
index -= effect->local_buffer_count;
l = &This->local_buffers[index];
if (effect->pool)
return effect->pool->lpVtbl->GetConstantBufferByIndex(effect->pool, index);
TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name));
WARN("Invalid index specified\n");
return (ID3D10EffectConstantBuffer *)&l->ID3D10EffectVariable_iface;
return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface;
}
static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,

View File

@ -6607,17 +6607,13 @@ todo_wine
cb = child_effect->lpVtbl->GetConstantBufferByIndex(child_effect, 2);
ret = cb->lpVtbl->IsValid(cb);
todo_wine
ok(ret, "Unexpected invalid variable.\n");
hr = cb->lpVtbl->GetDesc(cb, &var_desc);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr))
{
ok(!strcmp(var_desc.Name, "s_cb"), "Unexpected name %s.\n", var_desc.Name);
ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
}
ok(!strcmp(var_desc.Name, "s_cb"), "Unexpected name %s.\n", var_desc.Name);
todo_wine
ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
/* Pool techniques are not accessible */
t = effect->lpVtbl->GetTechniqueByIndex(effect, 0);