Connor McAdams : d3dcompiler: Implement d3d10 GetConstantBufferByIndex().

Alexandre Julliard julliard at winehq.org
Wed Nov 13 16:01:12 CST 2019


Module: wine
Branch: master
Commit: 13a5a3cadcca4914f63268ab7a7c1cfb2382e332
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=13a5a3cadcca4914f63268ab7a7c1cfb2382e332

Author: Connor McAdams <conmanx360 at gmail.com>
Date:   Wed Nov 13 16:27:25 2019 +0100

d3dcompiler: Implement d3d10 GetConstantBufferByIndex().

Signed-off-by: Connor McAdams <conmanx360 at gmail.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dcompiler_43/reflection.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index 6bad13e3a0..a88c444eaa 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -1927,9 +1927,17 @@ static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_GetDesc(ID3D10ShaderRef
 static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_shader_reflection_GetConstantBufferByIndex(
         ID3D10ShaderReflection *iface, UINT index)
 {
-    FIXME("iface %p, index %u stub!\n", iface, index);
+    struct d3dcompiler_shader_reflection *reflection = impl_from_ID3D10ShaderReflection(iface);
 
-    return NULL;
+    TRACE("iface %p, index %u.\n", iface, index);
+
+    if (index >= reflection->constant_buffer_count)
+    {
+        WARN("Invalid argument specified.\n");
+        return &null_constant_buffer.ID3D10ShaderReflectionConstantBuffer_iface;
+    }
+
+    return &reflection->constant_buffers[index].ID3D10ShaderReflectionConstantBuffer_iface;
 }
 
 static struct ID3D10ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d10_shader_reflection_GetConstantBufferByName(




More information about the wine-cvs mailing list