Added more VPROF to see what's taking that much fps

This commit is contained in:
Kamay Xutax 2024-09-04 18:41:58 +02:00
parent 2e40751236
commit 4b2b5e7388
2 changed files with 43 additions and 36 deletions

View file

@ -1151,6 +1151,8 @@ bool CClientLeafSystem::EnumerateLeaf( int leaf, intp context )
void CClientLeafSystem::InsertIntoTree( ClientRenderHandle_t &handle )
{
VPROF_BUDGET( "CClientLeafSystem::PreRender", "InsertIntoTree" );
if ( ThreadInMainThread() )
{
// When we insert into the tree, increase the shadow enumerator
@ -1181,6 +1183,8 @@ void CClientLeafSystem::InsertIntoTree( ClientRenderHandle_t &handle )
//-----------------------------------------------------------------------------
void CClientLeafSystem::RemoveFromTree( ClientRenderHandle_t handle )
{
VPROF_BUDGET( "CClientLeafSystem::PreRender", "RemoveFromTree" );
m_RenderablesInLeaf.RemoveElement( handle );
// Remove all shadows cast onto the object

View file

@ -2906,47 +2906,50 @@ void CClientShadowMgr::PreRender()
}
}
//
// -- Render to Texture Shadows -----------------------
//
bool bRenderToTextureActive = r_shadowrendertotexture.GetBool();
if ( bRenderToTextureActive != m_RenderToTextureActive )
{
if ( m_RenderToTextureActive )
VPROF_BUDGET( "CClientShadowMgr::PreRender (after depth texturing)", VPROF_BUDGETGROUP_SHADOW_RENDERING );
//
// -- Render to Texture Shadows -----------------------
//
bool bRenderToTextureActive = r_shadowrendertotexture.GetBool();
if ( bRenderToTextureActive != m_RenderToTextureActive )
{
ShutdownRenderToTextureShadows();
}
else
{
InitRenderToTextureShadows();
if ( m_RenderToTextureActive )
{
ShutdownRenderToTextureShadows();
}
else
{
InitRenderToTextureShadows();
}
UpdateAllShadows();
return;
}
UpdateAllShadows();
return;
m_bUpdatingDirtyShadows = true;
unsigned short i = m_DirtyShadows.FirstInorder();
while ( i != m_DirtyShadows.InvalidIndex() )
{
ClientShadowHandle_t& handle = m_DirtyShadows[ i ];
Assert( m_Shadows.IsValidIndex( handle ) );
UpdateProjectedTextureInternal( handle, false );
i = m_DirtyShadows.NextInorder(i);
}
m_DirtyShadows.RemoveAll();
// Transparent shadows must remain dirty, since they were not re-projected
int nCount = m_TransparentShadows.Count();
for ( int i = 0; i < nCount; ++i )
{
m_DirtyShadows.Insert( m_TransparentShadows[i] );
}
m_TransparentShadows.RemoveAll();
m_bUpdatingDirtyShadows = false;
}
m_bUpdatingDirtyShadows = true;
unsigned short i = m_DirtyShadows.FirstInorder();
while ( i != m_DirtyShadows.InvalidIndex() )
{
ClientShadowHandle_t& handle = m_DirtyShadows[ i ];
Assert( m_Shadows.IsValidIndex( handle ) );
UpdateProjectedTextureInternal( handle, false );
i = m_DirtyShadows.NextInorder(i);
}
m_DirtyShadows.RemoveAll();
// Transparent shadows must remain dirty, since they were not re-projected
int nCount = m_TransparentShadows.Count();
for ( int i = 0; i < nCount; ++i )
{
m_DirtyShadows.Insert( m_TransparentShadows[i] );
}
m_TransparentShadows.RemoveAll();
m_bUpdatingDirtyShadows = false;
}