Module: wine Branch: master Commit: 135966f22ed7712a4c4b56db735adcb9cd851525 URL: http://source.winehq.org/git/wine.git/?a=commit;h=135966f22ed7712a4c4b56db73...
Author: Rico Schüller kgbricola@web.de Date: Mon Oct 26 18:38:13 2009 +0100
d3d10: Implement ID3D10Effect::GetVariableByIndex().
---
dlls/d3d10/effect.c | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index def2c1a..a6159b7 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1749,9 +1749,36 @@ static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetCon
static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index) { - FIXME("iface %p, index %u stub!\n", iface, index); + struct d3d10_effect *This = (struct d3d10_effect *)iface; + unsigned int i;
- return NULL; + TRACE("iface %p, index %u\n", iface, index); + + for (i = 0; i < This->local_buffer_count; ++i) + { + struct d3d10_effect_variable *l = &This->local_buffers[i]; + + if (index < l->type->member_count) + { + struct d3d10_effect_variable *v = &l->members[index]; + + TRACE("Returning variable %p.\n", v); + return (ID3D10EffectVariable *)v; + } + index -= l->type->member_count; + } + + if (index < This->local_variable_count) + { + struct d3d10_effect_variable *v = &This->local_variables[index]; + + TRACE("Returning variable %p.\n", v); + return (ID3D10EffectVariable *)v; + } + + WARN("Invalid index specified\n"); + + return (ID3D10EffectVariable *)&null_variable; }
static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, LPCSTR name)