From f7a1491a5ebd7d8ae3e9db55a8b49e66a08e6be6 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Tue, 14 Jun 2016 22:57:24 +0200 Subject: [PATCH] d3dx11: Implement D3DX11CompileFromMemory(). Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- configure | 2 +- configure.ac | 2 +- dlls/d3dx11_42/d3dx11_42.spec | 2 +- dlls/d3dx11_43/Makefile.in | 6 ++++- dlls/d3dx11_43/async.c | 43 +++++++++++++++++++++++++++++++++++ dlls/d3dx11_43/d3dx11_43.c | 2 +- dlls/d3dx11_43/d3dx11_43.spec | 2 +- include/Makefile.in | 1 + include/d3dx11async.h | 37 ++++++++++++++++++++++++++++++ 9 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 dlls/d3dx11_43/async.c create mode 100644 include/d3dx11async.h diff --git a/configure b/configure index 6151ef893d7..d1a6a68cb54 100755 --- a/configure +++ b/configure @@ -17595,7 +17595,7 @@ wine_fn_config_dll d3dx10_42 enable_d3dx10_42 wine_fn_config_dll d3dx10_43 enable_d3dx10_43 implib d3dx10 wine_fn_config_test dlls/d3dx10_43/tests d3dx10_43_test wine_fn_config_dll d3dx11_42 enable_d3dx11_42 -wine_fn_config_dll d3dx11_43 enable_d3dx11_43 +wine_fn_config_dll d3dx11_43 enable_d3dx11_43 implib d3dx11 wine_fn_config_dll d3dx9_24 enable_d3dx9_24 wine_fn_config_dll d3dx9_25 enable_d3dx9_25 wine_fn_config_dll d3dx9_26 enable_d3dx9_26 diff --git a/configure.ac b/configure.ac index a2b17053697..7f234b2c14c 100644 --- a/configure.ac +++ b/configure.ac @@ -2841,7 +2841,7 @@ WINE_CONFIG_DLL(d3dx10_42) WINE_CONFIG_DLL(d3dx10_43,,[implib],[d3dx10]) WINE_CONFIG_TEST(dlls/d3dx10_43/tests) WINE_CONFIG_DLL(d3dx11_42) -WINE_CONFIG_DLL(d3dx11_43) +WINE_CONFIG_DLL(d3dx11_43,,[implib],[d3dx11]) WINE_CONFIG_DLL(d3dx9_24) WINE_CONFIG_DLL(d3dx9_25) WINE_CONFIG_DLL(d3dx9_26) diff --git a/dlls/d3dx11_42/d3dx11_42.spec b/dlls/d3dx11_42/d3dx11_42.spec index 3fd291c4b9f..b9172636406 100644 --- a/dlls/d3dx11_42/d3dx11_42.spec +++ b/dlls/d3dx11_42/d3dx11_42.spec @@ -1,7 +1,7 @@ @ stdcall D3DX11CheckVersion(long long) @ stub D3DX11CompileFromFileA @ stub D3DX11CompileFromFileW -@ stub D3DX11CompileFromMemory +@ stdcall D3DX11CompileFromMemory(str long str ptr ptr str str long long ptr ptr ptr ptr) d3dx11_43.D3DX11CompileFromMemory @ stub D3DX11CompileFromResourceA @ stub D3DX11CompileFromResourceW @ stub D3DX11ComputeNormalMap diff --git a/dlls/d3dx11_43/Makefile.in b/dlls/d3dx11_43/Makefile.in index 83366027b12..1cc4911c196 100644 --- a/dlls/d3dx11_43/Makefile.in +++ b/dlls/d3dx11_43/Makefile.in @@ -1,5 +1,9 @@ MODULE = d3dx11_43.dll +IMPORTLIB = d3dx11 +IMPORTS = d3dcompiler -C_SRCS = d3dx11_43.c +C_SRCS = \ + async.c \ + d3dx11_43.c RC_SRCS = version.rc diff --git a/dlls/d3dx11_43/async.c b/dlls/d3dx11_43/async.c new file mode 100644 index 00000000000..c809f2c4ef9 --- /dev/null +++ b/dlls/d3dx11_43/async.c @@ -0,0 +1,43 @@ +/* + * Copyright 2016 Matteo Bruni for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" +#include "d3dx11.h" +#include "d3dcompiler.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3dx); + +HRESULT WINAPI D3DX11CompileFromMemory(const char *data, SIZE_T data_size, const char *filename, + const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entry_point, + const char *target, UINT sflags, UINT eflags, ID3DX11ThreadPump *pump, ID3D10Blob **shader, + ID3D10Blob **error_messages, HRESULT *hresult) +{ + TRACE("data %s, data_size %lu, filename %s, defines %p, include %p, entry_point %s, target %s, " + "sflags %#x, eflage %#x, pump %p, shader %p, error_messages %p, hresult %p.\n", + debugstr_a(data), data_size, debugstr_a(filename), defines, include, entry_point, + debugstr_a(target), sflags, eflags, pump, shader, error_messages, hresult); + + if (pump) + FIXME("Unimplemented ID3DX11ThreadPump handling.\n"); + + return D3DCompile(data, data_size, filename, defines, include, entry_point, target, + sflags, eflags, shader, error_messages); +} diff --git a/dlls/d3dx11_43/d3dx11_43.c b/dlls/d3dx11_43/d3dx11_43.c index a60961326ca..149d953acd7 100644 --- a/dlls/d3dx11_43/d3dx11_43.c +++ b/dlls/d3dx11_43/d3dx11_43.c @@ -26,7 +26,7 @@ #include "winbase.h" #include "winuser.h" #include "objbase.h" -#include "d3d11.h" +#include "d3dx11.h" BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved) { diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index 3fd291c4b9f..a2a32ff87e7 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -1,7 +1,7 @@ @ stdcall D3DX11CheckVersion(long long) @ stub D3DX11CompileFromFileA @ stub D3DX11CompileFromFileW -@ stub D3DX11CompileFromMemory +@ stdcall D3DX11CompileFromMemory(str long str ptr ptr str str long long ptr ptr ptr ptr) @ stub D3DX11CompileFromResourceA @ stub D3DX11CompileFromResourceW @ stub D3DX11ComputeNormalMap diff --git a/include/Makefile.in b/include/Makefile.in index d981ac53055..b2002a90783 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -258,6 +258,7 @@ HEADER_SRCS = \ d3dx10async.h \ d3dx10tex.h \ d3dx11.h \ + d3dx11async.h \ d3dx11tex.h \ d3dx9.h \ d3dx9anim.h \ diff --git a/include/d3dx11async.h b/include/d3dx11async.h new file mode 100644 index 00000000000..210067bc574 --- /dev/null +++ b/include/d3dx11async.h @@ -0,0 +1,37 @@ +/* + * Copyright 2016 Matteo Bruni for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __D3DX11ASYNC_H__ +#define __D3DX11ASYNC_H__ + +#include "d3dx11.h" + +#ifdef __cplusplus +extern "C" { +#endif + +HRESULT WINAPI D3DX11CompileFromMemory(const char *data, SIZE_T data_size, const char *filename, + const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entry_point, + const char *target, UINT sflags, UINT eflags, ID3DX11ThreadPump *pump, ID3D10Blob **shader, + ID3D10Blob **error_messages, HRESULT *hresult); + +#ifdef __cplusplus +} +#endif + +#endif