Modify D3D10ReflectShader to now use the d3dcompiler_shader_reflection_init function, and take D3D11 reflect shader vtbl assignment out of it so it is version agnostic.
Signed-off-by: Connor McAdams conmanx360@gmail.com --- dlls/d3dcompiler_43/reflection.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dcompiler_43/reflection.c b/dlls/d3dcompiler_43/reflection.c index dc91472a37..63c99ad2b7 100644 --- a/dlls/d3dcompiler_43/reflection.c +++ b/dlls/d3dcompiler_43/reflection.c @@ -1813,9 +1813,6 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl HRESULT hr; unsigned int i;
- reflection->ID3D11ShaderReflection_iface.lpVtbl = &d3dcompiler_shader_reflection_vtbl; - reflection->refcount = 1; - wine_rb_init(&reflection->types, d3dcompiler_shader_reflection_type_compare);
hr = dxbc_parse(data, data_size, &src_dxbc); @@ -1932,8 +1929,9 @@ err_out: HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector) { struct d3dcompiler_shader_reflection *object; + HRESULT hr;
- FIXME("data %p, data_size %lu, reflector %p stub!\n", data, data_size, reflector); + TRACE("data %p, data_size %lu, reflector %p.\n", data, data_size, reflector);
if (!(object = heap_alloc_zero(sizeof(*object)))) { @@ -1944,6 +1942,14 @@ HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10Shad object->ID3D10ShaderReflection_iface.lpVtbl = &d3d10_shader_reflection_vtbl; object->refcount = 1;
+ hr = d3dcompiler_shader_reflection_init(object, data, data_size); + if (FAILED(hr)) + { + WARN("Failed to initialize shader reflection.\n"); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + *reflector = &object->ID3D10ShaderReflection_iface;
TRACE("Created ID3D10ShaderReflection %p.\n", object); @@ -1982,6 +1988,9 @@ HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void if (!object) return E_OUTOFMEMORY;
+ object->ID3D11ShaderReflection_iface.lpVtbl = &d3dcompiler_shader_reflection_vtbl; + object->refcount = 1; + hr = d3dcompiler_shader_reflection_init(object, data, data_size); if (FAILED(hr)) {