DX12 dependencies fix

This commit is contained in:
Nekotekina 2015-11-16 02:27:19 +03:00
parent 8edef32c76
commit 4a669fd86e
15 changed files with 46 additions and 31 deletions

View file

@ -173,7 +173,7 @@ if(WIN32) # I'm not sure we need all of these libs, but we link them in vs
if(NOT MSVC)
target_link_libraries(rpcs3 ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} opengl32.lib glu32.lib)
else()
target_link_libraries(rpcs3 dxgi.lib d2d1.lib dwrite.lib d3dcompiler.lib)
target_link_libraries(rpcs3 dxgi.lib d2d1.lib dwrite.lib)
endif()
target_link_libraries(rpcs3 asmjit.lib avformat.lib avcodec.lib avutil.lib swresample.lib swscale.lib ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${ADDITIONAL_LIBS})
else()

View file

@ -13,7 +13,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{FAC9B17B-F4B8-4B75-8AEB-C8C7CB92B078}</ProjectGuid>
<RootNamespace>D3D12GSRender</RootNamespace>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

View file

@ -14,11 +14,13 @@ PFN_D3D12_CREATE_DEVICE wrapD3D12CreateDevice;
PFN_D3D12_GET_DEBUG_INTERFACE wrapD3D12GetDebugInterface;
PFN_D3D12_SERIALIZE_ROOT_SIGNATURE wrapD3D12SerializeRootSignature;
PFN_D3D11ON12_CREATE_DEVICE wrapD3D11On12CreateDevice;
pD3DCompile wrapD3DCompile;
namespace
{
HMODULE D3D12Module;
HMODULE D3D11Module;
HMODULE D3DCompiler;
void loadD3D12FunctionPointers()
{
@ -32,12 +34,15 @@ void loadD3D12FunctionPointers()
if (!D3D11Module)
unreachable("Failed to load d3d11.dll");
wrapD3D11On12CreateDevice = (PFN_D3D11ON12_CREATE_DEVICE)GetProcAddress(D3D11Module, "D3D11On12CreateDevice");
CHECK_ASSERTION(D3DCompiler = LoadLibrary(L"d3dcompiler_47.dll"));
wrapD3DCompile = (pD3DCompile)GetProcAddress(D3DCompiler, "D3DCompile");
}
void unloadD3D12FunctionPointers()
{
FreeLibrary(D3D12Module);
FreeLibrary(D3D11Module);
FreeLibrary(D3DCompiler);
}
/**

View file

@ -7,6 +7,8 @@
#define TO_STRING(x) #x
extern pD3DCompile wrapD3DCompile;
void Shader::Compile(const std::string &code, SHADER_TYPE st)
{
HRESULT hr;
@ -19,12 +21,12 @@ void Shader::Compile(const std::string &code, SHADER_TYPE st)
switch (st)
{
case SHADER_TYPE::SHADER_TYPE_VERTEX:
hr = D3DCompile(code.c_str(), code.size(), "VertexProgram.hlsl", nullptr, nullptr, "main", "vs_5_0", compileFlags, 0, &bytecode, errorBlob.GetAddressOf());
hr = wrapD3DCompile(code.c_str(), code.size(), "VertexProgram.hlsl", nullptr, nullptr, "main", "vs_5_0", compileFlags, 0, &bytecode, errorBlob.GetAddressOf());
if (hr != S_OK)
LOG_ERROR(RSX, "VS build failed:%s", errorBlob->GetBufferPointer());
break;
case SHADER_TYPE::SHADER_TYPE_FRAGMENT:
hr = D3DCompile(code.c_str(), code.size(), "FragmentProgram.hlsl", nullptr, nullptr, "main", "ps_5_0", compileFlags, 0, &bytecode, errorBlob.GetAddressOf());
hr = wrapD3DCompile(code.c_str(), code.size(), "FragmentProgram.hlsl", nullptr, nullptr, "main", "ps_5_0", compileFlags, 0, &bytecode, errorBlob.GetAddressOf());
if (hr != S_OK)
LOG_ERROR(RSX, "FS build failed:%s", errorBlob->GetBufferPointer());
break;

View file

@ -9,6 +9,7 @@
#define STRINGIFY(x) #x
extern PFN_D3D12_SERIALIZE_ROOT_SIGNATURE wrapD3D12SerializeRootSignature;
extern pD3DCompile wrapD3DCompile;
/**
* returns bytecode and root signature of a Compute Shader converting texture from
@ -30,7 +31,7 @@ std::pair<ID3DBlob *, ID3DBlob *> compileF32toU8CS()
ID3DBlob *bytecode;
Microsoft::WRL::ComPtr<ID3DBlob> errorBlob;
HRESULT hr = D3DCompile(shaderCode, strlen(shaderCode), "test", nullptr, nullptr, "main", "cs_5_0", 0, 0, &bytecode, errorBlob.GetAddressOf());
HRESULT hr = wrapD3DCompile(shaderCode, strlen(shaderCode), "test", nullptr, nullptr, "main", "cs_5_0", 0, 0, &bytecode, errorBlob.GetAddressOf());
if (hr != S_OK)
{
const char *tmp = (const char*)errorBlob->GetBufferPointer();
@ -80,7 +81,7 @@ void D3D12GSRender::Shader::Init(ID3D12Device *device, ID3D12CommandQueue *gfxco
Microsoft::WRL::ComPtr<ID3DBlob> fsBytecode;
Microsoft::WRL::ComPtr<ID3DBlob> errorBlob;
HRESULT hr = D3DCompile(fsCode, strlen(fsCode), "test", nullptr, nullptr, "main", "ps_5_0", 0, 0, &fsBytecode, errorBlob.GetAddressOf());
HRESULT hr = wrapD3DCompile(fsCode, strlen(fsCode), "test", nullptr, nullptr, "main", "ps_5_0", 0, 0, &fsBytecode, errorBlob.GetAddressOf());
if (hr != S_OK)
{
const char *tmp = (const char*)errorBlob->GetBufferPointer();
@ -110,7 +111,7 @@ void D3D12GSRender::Shader::Init(ID3D12Device *device, ID3D12CommandQueue *gfxco
);
Microsoft::WRL::ComPtr<ID3DBlob> vsBytecode;
hr = D3DCompile(vsCode, strlen(vsCode), "test", nullptr, nullptr, "main", "vs_5_0", 0, 0, &vsBytecode, errorBlob.GetAddressOf());
hr = wrapD3DCompile(vsCode, strlen(vsCode), "test", nullptr, nullptr, "main", "vs_5_0", 0, 0, &vsBytecode, errorBlob.GetAddressOf());
if (hr != S_OK)
{
const char *tmp = (const char*)errorBlob->GetBufferPointer();

View file

@ -21,6 +21,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{00D36322-6188-4A66-B514-3B3F183E998D}</ProjectGuid>
<RootNamespace>copy_setup_h</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="..\wxWidgets\build\msw\wx_config.props" />

View file

@ -645,7 +645,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{C4A10229-4712-4BD2-B63E-50D93C67A038}</ProjectGuid>
<RootNamespace>emucore</RootNamespace>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@ -708,7 +708,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
<IncludePath>.\;..\;..\asmjit\src\asmjit;..\wxWidgets\include\msvc;..\wxWidgets\include;.\OpenAL\include;..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);..\llvm\include;..\llvm_build\include;$(UniversalCRT_IncludePath);..\minidx9\Include;..\minidx12\Include</IncludePath>
<IntDir>$(Platform)\$(Configuration)\emucore\</IntDir>
<LibraryPath>$(LibraryPath)</LibraryPath>
<LibraryPath>$(UniversalCRT_LibraryPath_x64);$(LibraryPath)</LibraryPath>
<ExcludePath>$(ExcludePath)</ExcludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">

View file

@ -26,7 +26,7 @@
<ProjectGuid>{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>rpcs3</RootNamespace>
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">

View file

@ -4,5 +4,4 @@
#pragma comment(lib, "d2d1")
#pragma comment(lib, "DXGI")
#pragma comment(lib, "Dwrite")
#pragma comment(lib, "d3dcompiler.lib")
#endif