|
@@ -164,9 +164,9 @@ void DirectX12::initialize( WFenster * fenster, Vec2<int> backBufferSize, bool f
|
|
}
|
|
}
|
|
D3D12SerializeVersionedRootSignatureFunction d3d12svrsf = (D3D12SerializeVersionedRootSignatureFunction)GetProcAddress( d3d12DLL, "D3D12SerializeVersionedRootSignature" );
|
|
D3D12SerializeVersionedRootSignatureFunction d3d12svrsf = (D3D12SerializeVersionedRootSignatureFunction)GetProcAddress( d3d12DLL, "D3D12SerializeVersionedRootSignature" );
|
|
D3D12SerializeRootSignatureFunction d3d12srsf = (D3D12SerializeRootSignatureFunction)GetProcAddress( d3d12DLL, "D3D12SerializeRootSignature" );
|
|
D3D12SerializeRootSignatureFunction d3d12srsf = (D3D12SerializeRootSignatureFunction)GetProcAddress( d3d12DLL, "D3D12SerializeRootSignature" );
|
|
-#ifdef _DEBUG
|
|
|
|
D3D12GetDebugInterfaceFunction getDebugInterface = (D3D12GetDebugInterfaceFunction)GetProcAddress( d3d12DLL, "D3D12GetDebugInterface" );
|
|
D3D12GetDebugInterfaceFunction getDebugInterface = (D3D12GetDebugInterfaceFunction)GetProcAddress( d3d12DLL, "D3D12GetDebugInterface" );
|
|
getDebugInterface( __uuidof( ID3D12Debug ), (void **)& debug );
|
|
getDebugInterface( __uuidof( ID3D12Debug ), (void **)& debug );
|
|
|
|
+#ifdef _DEBUG
|
|
debug->EnableDebugLayer();
|
|
debug->EnableDebugLayer();
|
|
#endif
|
|
#endif
|
|
IDXGIFactory4 *factory;
|
|
IDXGIFactory4 *factory;
|
|
@@ -192,12 +192,14 @@ void DirectX12::initialize( WFenster * fenster, Vec2<int> backBufferSize, bool f
|
|
res = factory->EnumAdapters1( index++, ¤t );
|
|
res = factory->EnumAdapters1( index++, ¤t );
|
|
if( res == S_OK )
|
|
if( res == S_OK )
|
|
{
|
|
{
|
|
|
|
+ ID3D12Device2 *device = 0;
|
|
DXGI_ADAPTER_DESC1 dxgiAdapterDesc1;
|
|
DXGI_ADAPTER_DESC1 dxgiAdapterDesc1;
|
|
current->GetDesc1( &dxgiAdapterDesc1 );
|
|
current->GetDesc1( &dxgiAdapterDesc1 );
|
|
if( ( dxgiAdapterDesc1.Flags &DXGI_ADAPTER_FLAG_SOFTWARE ) == 0 &&
|
|
if( ( dxgiAdapterDesc1.Flags &DXGI_ADAPTER_FLAG_SOFTWARE ) == 0 &&
|
|
dxgiAdapterDesc1.DedicatedVideoMemory > maxVideoMemory &&
|
|
dxgiAdapterDesc1.DedicatedVideoMemory > maxVideoMemory &&
|
|
- SUCCEEDED( createDevice( current, D3D_FEATURE_LEVEL_12_1, __uuidof( ID3D12Device2 ), 0 ) ) )
|
|
|
|
|
|
+ SUCCEEDED( createDevice( current, D3D_FEATURE_LEVEL_12_1, __uuidof( ID3D12Device2 ), (void**)&device ) ) )
|
|
{
|
|
{
|
|
|
|
+ device->Release();
|
|
if( best )
|
|
if( best )
|
|
best->Release();
|
|
best->Release();
|
|
best = current;
|
|
best = current;
|
|
@@ -989,6 +991,12 @@ bool DirectX12::isAvailable()
|
|
getDLLRegister()->releaseDLL( "d3d12.dll" );
|
|
getDLLRegister()->releaseDLL( "d3d12.dll" );
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
+ D3D12GetDebugInterfaceFunction getDebugInterface = (D3D12GetDebugInterfaceFunction)GetProcAddress( d3d12DLL, "D3D12GetDebugInterface" );
|
|
|
|
+ ID3D12Debug *debug = 0;
|
|
|
|
+ getDebugInterface( __uuidof( ID3D12Debug ), (void **)&debug );
|
|
|
|
+#ifdef _DEBUG
|
|
|
|
+ debug->EnableDebugLayer();
|
|
|
|
+#endif
|
|
IDXGIFactory4 *factory;
|
|
IDXGIFactory4 *factory;
|
|
UINT createFactoryFlags = 0;
|
|
UINT createFactoryFlags = 0;
|
|
#if defined(_DEBUG)
|
|
#if defined(_DEBUG)
|
|
@@ -1010,11 +1018,14 @@ bool DirectX12::isAvailable()
|
|
{
|
|
{
|
|
DXGI_ADAPTER_DESC1 dxgiAdapterDesc1;
|
|
DXGI_ADAPTER_DESC1 dxgiAdapterDesc1;
|
|
current->GetDesc1( &dxgiAdapterDesc1 );
|
|
current->GetDesc1( &dxgiAdapterDesc1 );
|
|
|
|
+ ID3D12Device2 *device = 0;
|
|
if( ( dxgiAdapterDesc1.Flags &DXGI_ADAPTER_FLAG_SOFTWARE ) == 0 &&
|
|
if( ( dxgiAdapterDesc1.Flags &DXGI_ADAPTER_FLAG_SOFTWARE ) == 0 &&
|
|
- SUCCEEDED( createDevice( current, D3D_FEATURE_LEVEL_12_1, __uuidof( ID3D12Device2 ), 0 ) ) )
|
|
|
|
|
|
+ SUCCEEDED( createDevice( current, D3D_FEATURE_LEVEL_12_1, __uuidof( ID3D12Device2 ), (void**)&device ) ) )
|
|
{
|
|
{
|
|
|
|
+ device->Release();
|
|
current->Release();
|
|
current->Release();
|
|
factory->Release();
|
|
factory->Release();
|
|
|
|
+ debug->Release();
|
|
getDLLRegister()->releaseDLL( "dxgi.dll" );
|
|
getDLLRegister()->releaseDLL( "dxgi.dll" );
|
|
getDLLRegister()->releaseDLL( "d3d12.dll" );
|
|
getDLLRegister()->releaseDLL( "d3d12.dll" );
|
|
return 1;
|
|
return 1;
|