Rico Schüller : d3dcompiler: Implement ID3D11ShaderReflectionConstantBuffer::GetVariableByName().

Alexandre Julliard julliard at winehq.org
Tue Feb 22 10:36:10 CST 2011


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

Author: Rico Schüller <kgbricola at web.de>
Date:   Mon Feb 21 22:52:24 2011 +0100

d3dcompiler: Implement ID3D11ShaderReflectionConstantBuffer::GetVariableByName().

---

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

diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index 473fe45..7004a82 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -611,9 +611,31 @@ static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_ref
 static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByName(
         ID3D11ShaderReflectionConstantBuffer *iface, LPCSTR name)
 {
-    FIXME("iface %p, name %s stub!\n", iface, name);
+    struct d3dcompiler_shader_reflection_constant_buffer *This = impl_from_ID3D11ShaderReflectionConstantBuffer(iface);
+    unsigned int i;
 
-    return NULL;
+    TRACE("iface %p, name %s\n", iface, debugstr_a(name));
+
+    if (!name)
+    {
+        WARN("Invalid argument specified\n");
+        return &null_variable.ID3D11ShaderReflectionVariable_iface;
+    }
+
+    for (i = 0; i < This->variable_count; ++i)
+    {
+        struct d3dcompiler_shader_reflection_variable *v = &This->variables[i];
+
+        if (!strcmp(v->name, name))
+        {
+            TRACE("Returning ID3D11ShaderReflectionVariable %p.\n", v);
+            return &v->ID3D11ShaderReflectionVariable_iface;
+        }
+    }
+
+    WARN("Invalid name specified\n");
+
+    return &null_variable.ID3D11ShaderReflectionVariable_iface;
 }
 
 const struct ID3D11ShaderReflectionConstantBufferVtbl d3dcompiler_shader_reflection_constant_buffer_vtbl =




More information about the wine-cvs mailing list