Browse Source
fixed_pipeline_state: Hash and compare the whole structure
fixed_pipeline_state: Hash and compare the whole structure
Pad FixedPipelineState's size to 384 bytes to be a multiple of 16. Compare the whole struct with std::memcmp and hash with CityHash. Using CityHash instead of a naive hash should reduce the number of collisions. Improve used type traits to ensure this operation is safe. With these changes the improvements to the hashable pipeline state are: Optimized structure Hash: 89 ns Comparison: 103 ns Construction*: 164 ns Struct size: 384 bytes Original structure Hash: 148 ns Equal: 174 ns Construction*: 281 ns Size: 1384 bytes * Attribute state initialization is not measured These measures are averages taken with std::chrono::high_accuracy_clock on MSVC shipped on Visual Studio 16.6.0 Preview 2.1.pull/15/merge
2 changed files with 9 additions and 105 deletions
-
60src/video_core/renderer_vulkan/fixed_pipeline_state.cpp
-
54src/video_core/renderer_vulkan/fixed_pipeline_state.h
Write
Preview
Loading…
Cancel
Save
Reference in new issue