From 48f66efbfe506fdbccaa9a127c61e14e46d70a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rico=20Sch=C3=BCller?= Date: Thu, 20 Aug 2009 19:06:49 +0200 Subject: [PATCH] d3d10: Implement GetConstantBufferByIndex. --- dlls/d3d10/effect.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index f40d5fdc6fd..a5a32e1e74c 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -831,9 +831,22 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface, UINT index) { - FIXME("iface %p, index %u stub!\n", iface, index); + struct d3d10_effect *This = (struct d3d10_effect *)iface; + struct d3d10_effect_local_buffer *l; - return NULL; + TRACE("iface %p, index %u\n", iface, index); + + if (index >= This->local_buffer_count) + { + WARN("Invalid index specified\n"); + return NULL; + } + + l = &This->local_buffers[index]; + + TRACE("Returning buffer %p, \"%s\"\n", l, l->name); + + return (ID3D10EffectConstantBuffer *)l; } static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,