Browse Source

Fehler behoben in der dx12 engine

Kolja Strohm 5 years ago
parent
commit
28d0ed59d9
1 changed files with 4 additions and 2 deletions
  1. 4 2
      DX12GraphicsApi.cpp

+ 4 - 2
DX12GraphicsApi.cpp

@@ -164,9 +164,9 @@ void DirectX12::initialize( WFenster * fenster, Vec2<int> backBufferSize, bool f
     }
     D3D12SerializeVersionedRootSignatureFunction d3d12svrsf = (D3D12SerializeVersionedRootSignatureFunction)GetProcAddress( d3d12DLL, "D3D12SerializeVersionedRootSignature" );
     D3D12SerializeRootSignatureFunction d3d12srsf = (D3D12SerializeRootSignatureFunction)GetProcAddress( d3d12DLL, "D3D12SerializeRootSignature" );
+#ifdef _DEBUG
     D3D12GetDebugInterfaceFunction getDebugInterface = (D3D12GetDebugInterfaceFunction)GetProcAddress( d3d12DLL, "D3D12GetDebugInterface" );
     getDebugInterface( __uuidof( ID3D12Debug ), (void **)& debug );
-#ifdef _DEBUG
     debug->EnableDebugLayer();
 #endif
     IDXGIFactory4 *factory;
@@ -990,10 +990,10 @@ bool DirectX12::isAvailable()
         getDLLRegister()->releaseDLL( "d3d12.dll" );
         return 0;
     }
+#ifdef _DEBUG
     D3D12GetDebugInterfaceFunction getDebugInterface = (D3D12GetDebugInterfaceFunction)GetProcAddress( d3d12DLL, "D3D12GetDebugInterface" );
     ID3D12Debug *debug = 0;
     getDebugInterface( __uuidof( ID3D12Debug ), (void **)& debug );
-#ifdef _DEBUG
     debug->EnableDebugLayer();
 #endif
     IDXGIFactory4 *factory;
@@ -1024,7 +1024,9 @@ bool DirectX12::isAvailable()
                 device->Release();
                 current->Release();
                 factory->Release();
+#ifdef _DEBUG
                 debug->Release();
+#endif
                 getDLLRegister()->releaseDLL( "dxgi.dll" );
                 getDLLRegister()->releaseDLL( "d3d12.dll" );
                 return 1;