Rico Schüller : d3dcompiler: Implement ID3D11ShaderReflection::GetConstantBufferByIndex().

Alexandre Julliard julliard at winehq.org
Mon Feb 21 10:56:58 CST 2011


Module: wine
Branch: master
Commit: a7483f4bcc13f287c1f1b0150304ee471b12fcfd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a7483f4bcc13f287c1f1b0150304ee471b12fcfd

Author: Rico Schüller <kgbricola at web.de>
Date:   Sun Feb 20 21:21:14 2011 +0100

d3dcompiler: Implement ID3D11ShaderReflection::GetConstantBufferByIndex().

---

 dlls/d3dcompiler_43/reflection.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index b382d83..3c4d138 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -31,6 +31,11 @@ enum D3DCOMPILER_SIGNATURE_ELEMENT_SIZE
     D3DCOMPILER_SIGNATURE_ELEMENT_SIZE7 = 7,
 };
 
+const struct ID3D11ShaderReflectionConstantBufferVtbl d3dcompiler_shader_reflection_constant_buffer_vtbl;
+
+/* null objects - needed for invalid calls */
+static struct d3dcompiler_shader_reflection_constant_buffer null_constant_buffer = {{&d3dcompiler_shader_reflection_constant_buffer_vtbl}};
+
 static BOOL copy_name(const char *ptr, char **name)
 {
     size_t name_len;
@@ -216,9 +221,17 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetDesc(ID3D11Sha
 static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByIndex(
         ID3D11ShaderReflection *iface, UINT index)
 {
-    FIXME("iface %p, index %u stub!\n", iface, index);
+    struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface);
 
-    return NULL;
+    TRACE("iface %p, index %u\n", iface, index);
+
+    if (index >= This->constant_buffer_count)
+    {
+        WARN("Invalid argument specified\n");
+        return &null_constant_buffer.ID3D11ShaderReflectionConstantBuffer_iface;
+    }
+
+    return &This->constant_buffers[index].ID3D11ShaderReflectionConstantBuffer_iface;
 }
 
 static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByName(




More information about the wine-cvs mailing list