From 0ef73c98c82c7163f1f2bcc67e05556a9f3a7e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 8 Mar 2016 16:39:59 -0800 Subject: [PATCH] Cleanup. --- scripts/genie.lua | 1 + src/renderer_d3d11.cpp | 9 ++++++--- src/renderer_d3d12.cpp | 5 +---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index a0fa5b712..97fe14030 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -248,6 +248,7 @@ function exampleProject(_name) configuration { "durango" } links { "d3d11_x", + "d3d12_x", "combase", "kernelx", } diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index a9c84571e..c899c0fb2 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -505,6 +505,7 @@ namespace bgfx { namespace d3d11 void trim(ID3D11Device* _device) { +#if BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT IDXGIDevice3* device; HRESULT hr = _device->QueryInterface(IID_IDXGIDevice3, (void**)&device); if (SUCCEEDED(hr) ) @@ -512,6 +513,9 @@ namespace bgfx { namespace d3d11 device->Trim(); DX_RELEASE(device, 1); } +#else + BX_UNUSED(_device); +#endif // BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT } // Reference: @@ -1518,8 +1522,8 @@ BX_PRAGMA_DIAGNOSTIC_POP(); DX_RELEASE(m_device, 0); DX_RELEASE(m_factory, 0); - case ErrorState::LoadedDXGI: #if USE_D3D11_DYNAMIC_LIB + case ErrorState::LoadedDXGI: if (NULL != m_dxgidebugdll) { bx::dlclose(m_dxgidebugdll); @@ -1534,15 +1538,14 @@ BX_PRAGMA_DIAGNOSTIC_POP(); bx::dlclose(m_dxgidll); m_dxgidll = NULL; -#endif // USE_D3D11_DYNAMIC_LIB case ErrorState::LoadedD3D11: -#if USE_D3D11_DYNAMIC_LIB bx::dlclose(m_d3d11dll); m_d3d11dll = NULL; #endif // USE_D3D11_DYNAMIC_LIB case ErrorState::Default: + default: if (NULL != m_ags) { agsDeInit(m_ags); diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 1a5bef94b..d1475c652 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -8,10 +8,6 @@ #if BGFX_CONFIG_RENDERER_DIRECT3D12 # include "renderer_d3d12.h" -# if !USE_D3D12_DYNAMIC_LIB -# pragma comment(lib, "D3D12.lib") -# endif // !USE_D3D12_DYNAMIC_LIB - namespace bgfx { namespace d3d12 { static wchar_t s_viewNameW[BGFX_CONFIG_MAX_VIEWS][256]; @@ -1083,6 +1079,7 @@ namespace bgfx { namespace d3d12 bx::dlclose(m_kernel32dll); #endif // USE_D3D12_DYNAMIC_LIB case ErrorState::Default: + default: break; }