Files
UnrealEngineUWP/Engine/Source/Developer/ShaderPreprocessor
jason hoerner e1fe70dbca Shader Compiler: GlobalBeginCompileShader define optimizations, plus a few other micro-optimizations, producing a 3.2x performance improvement.
* Major define optimization involves converting map of defines to use FName keys and variant values rather than strings -- this eliminates most of the cost of string hashing, allocation, and conversion.
* Lower overhead FHashTable used instead of TMap.
* An initial map of defines can optionally be provided globally.  Anything using an initial define can have its map index cached for optimized lookup when reading or writing.

Other micro-optimizations:
* Added Reserve calls for uniform buffer related maps, to eliminate map resizing / rehashing.  Saved around 15% perf (after define optimizations).
* Added a map for UB lookup, instead of iterating through the linked list.  Saved around 10% perf.

Non-optimization:  Sort the order in which uniform buffer variable names are searched in BuildShaderFileToUniformBufferMap, to create determinism in ShaderDebug data for A/B testing (previously order was dependent on global constructor order for UB definitions, which could vary arbitrarily with unrelated changes).

#jira UE-187334
#rnx
#rb dan.elksnitis jason.nadro yuriy.odonnell

[CL 26142884 by jason hoerner in ue5-main branch]
2023-06-21 03:26:02 -04:00
..
2023-05-03 10:17:48 -04:00