Skip to content

Commit 9da5d5b

Browse files
committed
add easy toggle
1 parent b5d5149 commit 9da5d5b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

materialsystem/cmaterialsystem.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3702,10 +3702,17 @@ void CMaterialSystem::EndFrame( void )
37023702

37033703
if ( m_pActiveAsyncJob )
37043704
{
3705+
#if 1
37053706
while ( !m_pActiveAsyncJob->IsFinished() )
37063707
{
37073708
m_pActiveAsyncJob->WaitForFinish(0);
37083709
}
3710+
#else
3711+
if ( !m_pActiveAsyncJob->IsFinished() )
3712+
{
3713+
m_pActiveAsyncJob->WaitForFinish();
3714+
}
3715+
#endif
37093716
// Sync with GPU if we had a job for it, even if it finished early on CPU!
37103717
if (!IsPC() && g_config.ForceHWSync())
37113718
{
@@ -4964,10 +4971,17 @@ MaterialLock_t CMaterialSystem::Lock()
49644971
#if 1 // Rick's optimization: not sure this is needed anymore
49654972
if ( pCurContext != &m_HardwareRenderContext && m_pActiveAsyncJob )
49664973
{
4974+
#if 1
49674975
while (!m_pActiveAsyncJob->IsFinished())
49684976
{
49694977
m_pActiveAsyncJob->WaitForFinish(0);
49704978
}
4979+
#else
4980+
if (!m_pActiveAsyncJob->IsFinished())
4981+
{
4982+
m_pActiveAsyncJob->WaitForFinish();
4983+
}
4984+
#endif
49714985
// threadsafety note: not releasing or nulling pointer.
49724986
}
49734987

0 commit comments

Comments
 (0)