diff options
| author | NeoBrainX <NeoBrainX@googlemail.com> | 2010-06-27 16:08:54 +0000 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@googlemail.com> | 2010-06-27 16:08:54 +0000 |
| commit | d256dd2083e10b6a4e8ca2b85d201a3930a0f9d2 (patch) | |
| tree | f2246474d688a82b0a627883287b2032cdfe0424 /Source | |
| parent | 18ccffdb64a36a9eaf1e7e282efe19e7ef67afb2 (diff) | |
Drop d3dcompiler_xx.dll dependence, using D3DX11CompileFromMemory instead.
Hopefully solves the remaining issues from r5805.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5806 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj | 12 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX11/Src/D3DBase.cpp | 10 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX11/Src/D3DBase.h | 3 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX11/Src/D3DShader.cpp | 8 |
4 files changed, 19 insertions, 14 deletions
diff --git a/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj b/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj index 0e7ab044aa..6f7a3b60d1 100644 --- a/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj +++ b/Source/Plugins/Plugin_VideoDX11/Plugin_VideoDX11.vcproj @@ -91,7 +91,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions=""..\..\core\common\win32\release\common.lib"" - AdditionalDependencies="odbc32.lib d3dcompiler.lib odbccp32.lib comctl32.lib dxguid.lib d3d11.lib dxgi.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib dxguid.lib d3d11.lib dxgi.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib" OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX11.dll" LinkIncremental="1" SuppressStartupBanner="true" @@ -199,7 +199,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib d3dcompiler.lib odbccp32.lib comctl32.lib dxguid.lib d3d11.lib dxgi.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib dxguid.lib d3d11.lib dxgi.lib winmm.lib vfw32.lib wxbase28u.lib wxmsw28u_core.lib" OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX11.dll" LinkIncremental="1" SuppressStartupBanner="true" @@ -297,7 +297,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions=""..\..\core\common\win32\debug\common.lib"" - AdditionalDependencies="odbc32.lib d3dcompiler.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib d3d11.lib dxgi.lib Rpcrt4.lib winmm.lib vfw32.lib wxbase28ud.lib wxmsw28ud_core.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib d3d11.lib dxgi.lib Rpcrt4.lib winmm.lib vfw32.lib wxbase28ud.lib wxmsw28ud_core.lib" OutputFile="..\..\..\Binary\Win32/Plugins\Plugin_VideoDX11D.dll" LinkIncremental="1" SuppressStartupBanner="true" @@ -393,7 +393,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib d3dcompiler.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib d3d11.lib dxgi.lib Rpcrt4.lib winmm.lib vfw32.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib d3d11.lib dxgi.lib Rpcrt4.lib winmm.lib vfw32.lib" OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX11D.dll" LinkIncremental="1" SuppressStartupBanner="true" @@ -499,7 +499,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib d3dcompiler.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib d3d11.lib dxgi.lib Rpcrt4.lib winmm.lib vfw32.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib d3d11.lib dxgi.lib Rpcrt4.lib winmm.lib vfw32.lib" OutputFile="..\..\..\Binary\Win32\Plugins\Plugin_VideoDX11DF.dll" LinkIncremental="1" SuppressStartupBanner="true" @@ -608,7 +608,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="odbc32.lib d3dcompiler.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib d3d11.lib dxgi.lib Rpcrt4.lib winmm.lib vfw32.lib" + AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib uuid.lib dxguid.lib d3d11.lib dxgi.lib Rpcrt4.lib winmm.lib vfw32.lib" OutputFile="..\..\..\Binary\x64\Plugins\Plugin_VideoDX11DF.dll" LinkIncremental="1" SuppressStartupBanner="true" diff --git a/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.cpp b/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.cpp index 0e1989308a..8a04f454c6 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.cpp @@ -30,6 +30,7 @@ using namespace std; HINSTANCE hD3DXDll = NULL; +D3DX11COMPILEFROMMEMORYTYPE PD3DX11CompileFromMemory = NULL; D3DX11FILTERTEXTURETYPE PD3DX11FilterTexture = NULL; D3DX11SAVETEXTURETOFILEATYPE PD3DX11SaveTextureToFileA = NULL; D3DX11SAVETEXTURETOFILEWTYPE PD3DX11SaveTextureToFileW = NULL; @@ -89,14 +90,17 @@ HRESULT Create(HWND wnd) NOTICE_LOG(VIDEO, "Successfully loaded %s.", StringFromFormat("d3dx11_%d.dll", D3DX11_SDK_VERSION).c_str()); } + PD3DX11CompileFromMemory = (D3DX11COMPILEFROMMEMORYTYPE)GetProcAddress(hD3DXDll, "D3DX11CompileFromMemory"); + if (PD3DX11CompileFromMemory == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DX11CompileFromMemory!", "Critical error", MB_OK | MB_ICONERROR); + PD3DX11FilterTexture = (D3DX11FILTERTEXTURETYPE)GetProcAddress(hD3DXDll, "D3DX11FilterTexture"); - if (PD3DX11FilterTexture == NULL) MessageBoxA(NULL, "GetProcAddress failed to D3DX11FilterTexture!", "Critical error", MB_OK | MB_ICONERROR); + if (PD3DX11FilterTexture == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DX11FilterTexture!", "Critical error", MB_OK | MB_ICONERROR); PD3DX11SaveTextureToFileA = (D3DX11SAVETEXTURETOFILEATYPE)GetProcAddress(hD3DXDll, "D3DX11SaveTextureToFileA"); - if (PD3DX11SaveTextureToFileA == NULL) MessageBoxA(NULL, "GetProcAddress failed to D3DX11SaveTextureToFileA!", "Critical error", MB_OK | MB_ICONERROR); + if (PD3DX11SaveTextureToFileA == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DX11SaveTextureToFileA!", "Critical error", MB_OK | MB_ICONERROR); PD3DX11SaveTextureToFileW = (D3DX11SAVETEXTURETOFILEWTYPE)GetProcAddress(hD3DXDll, "D3DX11SaveTextureToFileW"); - if (PD3DX11SaveTextureToFileW == NULL) MessageBoxA(NULL, "GetProcAddress failed to D3DX11SaveTextureToFileW!", "Critical error", MB_OK | MB_ICONERROR); + if (PD3DX11SaveTextureToFileW == NULL) MessageBoxA(NULL, "GetProcAddress failed for D3DX11SaveTextureToFileW!", "Critical error", MB_OK | MB_ICONERROR); // D3DX11 is fine, initialize D3D11 IDXGIFactory* factory; diff --git a/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.h b/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.h index 4331b6e524..efcd7c1438 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.h +++ b/Source/Plugins/Plugin_VideoDX11/Src/D3DBase.h @@ -69,10 +69,12 @@ inline void SetDebugObjectName(ID3D11DeviceChild* resource, const char* name) // compiler's SDK a requirement, but this plugin works with DX11 runtimes // back to August 2009 even if the plugin was built with June 2010. // Add any d3dx11 functions which you want to use here and load them in Create() +typedef HRESULT (WINAPI* D3DX11COMPILEFROMMEMORYTYPE)(LPCSTR, SIZE_T, LPCSTR, const D3D10_SHADER_MACRO*, LPD3D10INCLUDE, LPCSTR, LPCSTR, UINT, UINT, ID3DX11ThreadPump*, ID3D10Blob**, ID3D10Blob**, HRESULT*); typedef HRESULT (WINAPI* D3DX11FILTERTEXTURETYPE)(ID3D11DeviceContext*, ID3D11Resource*, UINT, UINT); typedef HRESULT (WINAPI* D3DX11SAVETEXTURETOFILEATYPE)(ID3D11DeviceContext*, ID3D11Resource*, D3DX11_IMAGE_FILE_FORMAT, LPCSTR); typedef HRESULT (WINAPI* D3DX11SAVETEXTURETOFILEWTYPE)(ID3D11DeviceContext*, ID3D11Resource*, D3DX11_IMAGE_FILE_FORMAT, LPCWSTR); +extern D3DX11COMPILEFROMMEMORYTYPE PD3DX11CompileFromMemory; extern D3DX11FILTERTEXTURETYPE PD3DX11FilterTexture; extern D3DX11SAVETEXTURETOFILEATYPE PD3DX11SaveTextureToFileA; extern D3DX11SAVETEXTURETOFILEWTYPE PD3DX11SaveTextureToFileW; @@ -82,4 +84,3 @@ extern D3DX11SAVETEXTURETOFILEWTYPE PD3DX11SaveTextureToFileW; #else #define PD3DX11SaveTextureToFile PD3DX11SaveTextureToFileA #endif - diff --git a/Source/Plugins/Plugin_VideoDX11/Src/D3DShader.cpp b/Source/Plugins/Plugin_VideoDX11/Src/D3DShader.cpp index 2cde29a35d..0a2b719e5d 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/D3DShader.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/D3DShader.cpp @@ -49,8 +49,8 @@ bool CompileVertexShader(const char* code, unsigned int len, D3DBlob** blob) #else UINT flags = D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY|D3D10_SHADER_OPTIMIZATION_LEVEL3|D3D10_SHADER_SKIP_VALIDATION; #endif - HRESULT hr = D3DCompile(code, len, NULL, NULL, NULL, "main", D3D::VertexShaderVersionString(), - flags, 0, &shaderBuffer, &errorBuffer); + HRESULT hr = PD3DX11CompileFromMemory(code, len, NULL, NULL, NULL, "main", D3D::VertexShaderVersionString(), + flags, 0, NULL, &shaderBuffer, &errorBuffer, NULL); if (FAILED(hr) || errorBuffer) { @@ -94,8 +94,8 @@ bool CompilePixelShader(const char* code, unsigned int len, D3DBlob** blob) #else UINT flags = D3D10_SHADER_OPTIMIZATION_LEVEL3; #endif - HRESULT hr = D3DCompile(code, len, NULL, NULL, NULL, "main", D3D::PixelShaderVersionString(), - flags, 0, &shaderBuffer, &errorBuffer); + HRESULT hr = PD3DX11CompileFromMemory(code, len, NULL, NULL, NULL, "main", D3D::PixelShaderVersionString(), + flags, 0, NULL, &shaderBuffer, &errorBuffer, NULL); if (FAILED(hr) || errorBuffer) { |
