Connor McAdams : d3dcompiler: Partially implement ID3D10ShaderReflectionVariable.

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


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

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

d3dcompiler: Partially implement ID3D10ShaderReflectionVariable.

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

diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c
index 7cfea141c4..a79439a3fe 100644
--- a/dlls/d3dcompiler_43/reflection.c
+++ b/dlls/d3dcompiler_43/reflection.c
@@ -1353,6 +1353,7 @@ static HRESULT d3dcompiler_parse_variables(struct d3dcompiler_shader_reflection_
         DWORD offset;
 
         v->ID3D11ShaderReflectionVariable_iface.lpVtbl = &d3dcompiler_shader_reflection_variable_vtbl;
+        v->ID3D10ShaderReflectionVariable_iface.lpVtbl = &d3d10_shader_reflection_variable_vtbl;
         v->constant_buffer = cb;
 
         read_dword(&ptr, &offset);
@@ -2095,6 +2096,53 @@ static const struct ID3D10ShaderReflectionConstantBufferVtbl d3d10_shader_reflec
     d3d10_shader_reflection_constant_buffer_GetVariableByName,
 };
 
+static inline struct d3dcompiler_shader_reflection_variable *impl_from_ID3D10ShaderReflectionVariable(ID3D10ShaderReflectionVariable *iface)
+{
+    return CONTAINING_RECORD(iface, struct d3dcompiler_shader_reflection_variable, ID3D10ShaderReflectionVariable_iface);
+}
+
+static HRESULT STDMETHODCALLTYPE d3d10_shader_reflection_variable_GetDesc(ID3D10ShaderReflectionVariable *iface,
+        D3D10_SHADER_VARIABLE_DESC *desc)
+{
+    struct d3dcompiler_shader_reflection_variable *var = impl_from_ID3D10ShaderReflectionVariable(iface);
+
+    TRACE("iface %p, desc %p.\n", iface, desc);
+
+    if (var == &null_variable)
+    {
+        WARN("Null variable specified.\n");
+        return E_FAIL;
+    }
+
+    if (!desc)
+    {
+        WARN("Invalid argument specified.\n");
+        return E_FAIL;
+    }
+
+    desc->Name = var->name;
+    desc->StartOffset = var->start_offset;
+    desc->Size = var->size;
+    desc->uFlags = var->flags;
+    desc->DefaultValue = var->default_value;
+
+    return S_OK;
+}
+
+static ID3D10ShaderReflectionType * STDMETHODCALLTYPE d3d10_shader_reflection_variable_GetType(
+        ID3D10ShaderReflectionVariable *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return &null_type.ID3D10ShaderReflectionType_iface;
+}
+
+static const struct ID3D10ShaderReflectionVariableVtbl d3d10_shader_reflection_variable_vtbl =
+{
+    d3d10_shader_reflection_variable_GetDesc,
+    d3d10_shader_reflection_variable_GetType,
+};
+
 HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector)
 {
     struct d3dcompiler_shader_reflection *object;




More information about the wine-cvs mailing list