mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 06:34:10 +00:00
Fix NVRHI device shutdown for SDL and do additional resource cleanup on exit
This commit is contained in:
parent
8219860378
commit
9734df5f01
5 changed files with 29 additions and 7 deletions
|
@ -785,7 +785,7 @@ void idImageManager::Shutdown()
|
|||
deferredImages.DeleteContents( true );
|
||||
deferredImageHash.Clear();
|
||||
#if defined( USE_NVRHI )
|
||||
commandList = nullptr;
|
||||
commandList.Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -286,6 +286,9 @@ void idRenderModelManagerLocal::Shutdown()
|
|||
{
|
||||
models.DeleteContents( true );
|
||||
hash.Free();
|
||||
#if defined( USE_NVRHI )
|
||||
commandList.Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -2284,6 +2284,10 @@ void idRenderSystemLocal::Shutdown()
|
|||
|
||||
Clear();
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
commandList.Reset();
|
||||
#endif
|
||||
|
||||
ShutdownOpenGL();
|
||||
|
||||
bInitialized = false;
|
||||
|
|
|
@ -1083,6 +1083,20 @@ void DeviceManager_VK::DestroyDeviceAndSwapChain()
|
|||
|
||||
m_BarrierCommandList = nullptr;
|
||||
|
||||
while( m_FramesInFlight.size() > 0 )
|
||||
{
|
||||
auto query = m_FramesInFlight.front();
|
||||
m_FramesInFlight.pop();
|
||||
query = nullptr;
|
||||
}
|
||||
|
||||
if( !m_QueryPool.empty() )
|
||||
{
|
||||
auto query = m_QueryPool.back();
|
||||
m_QueryPool.pop_back();
|
||||
query = nullptr;
|
||||
}
|
||||
|
||||
m_NvrhiDevice = nullptr;
|
||||
m_ValidationLayer = nullptr;
|
||||
m_RendererString.clear();
|
||||
|
|
|
@ -534,12 +534,6 @@ bool VKimp_SetScreenParms( glimpParms_t parms )
|
|||
void DeviceManager::Shutdown()
|
||||
{
|
||||
DestroyDeviceAndSwapChain();
|
||||
|
||||
// destroy window
|
||||
VKimp_Shutdown();
|
||||
|
||||
// restore gamma
|
||||
//VKimp_RestoreGamma();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -552,6 +546,13 @@ void VKimp_Shutdown()
|
|||
{
|
||||
common->Printf( "Shutting down Vulkan subsystem\n" );
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
if( deviceManager )
|
||||
{
|
||||
deviceManager->Shutdown();
|
||||
}
|
||||
#endif
|
||||
|
||||
if( window )
|
||||
{
|
||||
SDL_DestroyWindow( window );
|
||||
|
|
Loading…
Reference in a new issue