Skip to content

Commit 70c1142

Browse files
committed
Reduce log spam on registering shader with different flags
- Don't log if the shader has been registered with those flags before - Log only once per each new flag combination
1 parent a2383c6 commit 70c1142

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/engine/renderer/tr_shader.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6069,6 +6069,8 @@ shader_t *R_FindShader( const char *name, int flags )
60696069

60706070
hash = generateHashValue( strippedName, FILE_HASH_SIZE );
60716071

6072+
const shader_t *firstRegistration = nullptr;
6073+
60726074
// see if the shader is already loaded
60736075
for ( sh = shaderHashTable[ hash ]; sh; sh = sh->next )
60746076
{
@@ -6084,11 +6086,16 @@ shader_t *R_FindShader( const char *name, int flags )
60846086
return sh;
60856087
}
60866088

6087-
Log::Verbose( "shader %s registered with varying flags: previously with 0x%X, now with 0x%X",
6088-
strippedName, sh->registerFlags, flags );
6089+
firstRegistration = sh;
60896090
}
60906091
}
60916092

6093+
if ( firstRegistration != nullptr )
6094+
{
6095+
Log::Verbose( "shader %s registered with varying flags: first time with 0x%X, now with 0x%X",
6096+
strippedName, firstRegistration->registerFlags, flags );
6097+
}
6098+
60926099
shader.altShader[ 0 ].index = flags; // save for later use (in case of alternative shaders)
60936100

60946101
// make sure the render thread is stopped, because we are probably

0 commit comments

Comments
 (0)