Merge pull request #1430 from Azaezel/alpha41/GFXRedundancyCleanups

clean up (some) shader variation redundancies
This commit is contained in:
Brian Roberts 2025-04-02 16:21:57 -05:00 committed by GitHub
commit f41cdaaa7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 108 deletions

View file

@ -459,18 +459,12 @@ GFXShader* ShaderGen::getShader( const MaterialFeatureData &featureData, const G
// Build a description string from the features
// and vertex format combination ( and macros ).
String shaderDescription = vertexFormat->getDescription() + features.getDescription();
if ( macros && !macros->empty() )
{
String macroStr;
GFXShaderMacro::stringize( *macros, &macroStr );
shaderDescription += macroStr;
}
// Generate a single 64bit hash from the description string.
//
// Don't get paranoid! This has 1 in 18446744073709551616
// chance for collision... it won't happen in this lifetime.
//
shaderDescription.replace("\n", " ");
U64 hash = Torque::hash64( (const U8*)shaderDescription.c_str(), shaderDescription.length(), 0 );
hash = convertHostToLEndian(hash);
U32 high = (U32)( hash >> 32 );