Connor McAdams : d3dcompiler: Implement ID3D10ShaderReflectionConstantBuffer GetVariableByName() method.

Alexandre Julliard julliard at winehq.org
Thu Nov 14 15:51:28 CST 2019


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

Author: Connor McAdams <conmanx360 at gmail.com>
Date:   Thu Nov 14 20:59:58 2019 +0100

d3dcompiler: Implement ID3D10ShaderReflectionConstantBuffer GetVariableByName() method.

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 | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index 5c08cdf5e4..820e5c239f 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -2093,7 +2093,29 @@ static ID3D10ShaderReflectionVariable * STDMETHODCALLTYPE d3d10_shader_reflectio
 static ID3D10ShaderReflectionVariable * STDMETHODCALLTYPE d3d10_shader_reflection_constant_buffer_GetVariableByName(
         ID3D10ShaderReflectionConstantBuffer *iface, const char *name)
 {
-    FIXME("iface %p, name %s stub!\n", iface, name);
+    struct d3dcompiler_shader_reflection_constant_buffer *cb = impl_from_ID3D10ShaderReflectionConstantBuffer(iface);
+    unsigned int i;
+
+    TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
+
+    if (!name)
+    {
+        WARN("Invalid argument specified.\n");
+        return &null_variable.ID3D10ShaderReflectionVariable_iface;
+    }
+
+    for (i = 0; i < cb->variable_count; ++i)
+    {
+        struct d3dcompiler_shader_reflection_variable *v = &cb->variables[i];
+
+        if (!strcmp(v->name, name))
+        {
+            TRACE("Returning ID3D10ShaderReflectionVariable %p.\n", v);
+            return &v->ID3D10ShaderReflectionVariable_iface;
+        }
+    }
+
+    WARN("Invalid name specified.\n");
 
     return &null_variable.ID3D10ShaderReflectionVariable_iface;
 }




More information about the wine-cvs mailing list