Hash :
9b00af52
Author :
Date :
2023-02-01T11:10:32
Metal: Add an in-memory MTLLibrary cache. Add a small cache for (msl + compile parameters) -> MTLLibrary at the egl::Display level. In regular executions of Chrome, the same shaders (particularly vertex) are compiled multiple times in different programs. Tested for a regular Chrome startup + open wikipedia + motionmark 1.2: 112/282 (40%) cache hits. Several different caching methods were profiled (LinkProgram perf test) - struct key with std::map : 303309 - struct key with std::unordered_map : 308090 - binary blob key with std::map : 263595 - binary blob key with std::unordered_map : 286051 - struct key + is_transparent with std::unordered_map : 304877 - struct key + is_transparent with absl::flat_hash_map : 335686 Using is_transparent allows us to search the hash map without copying the shader source string to construct the key structure. Bug: chromium:1385510 Change-Id: Ieec4ba526fe286276a4af7114d89cde32a8f9e1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4214012 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
{
"include/platform/FeaturesD3D_autogen.h":
"256cd7175aa885e9ec57ecb86d455fc4",
"include/platform/FeaturesGL_autogen.h":
"38325ab28fca006d06f46d1ad4ad2d63",
"include/platform/FeaturesMtl_autogen.h":
"6fe5588c37d4e177fe6009efac2425b8",
"include/platform/FeaturesVk_autogen.h":
"4481f1e1198695596fceeb8152022529",
"include/platform/FrontendFeatures_autogen.h":
"be41034e621326dd51e86b139705ea39",
"include/platform/d3d_features.json":
"0d316218a4ac7c3bb9692e7525216973",
"include/platform/frontend_features.json":
"c2ace937cdaa65aedb66e7be5e5b761d",
"include/platform/gen_features.py":
"062989f7a8f3ff3b383f98fc8908dc33",
"include/platform/gl_features.json":
"83005189979f62258c7799ec6a6a7572",
"include/platform/mtl_features.json":
"0734ff4029e1db1a0c242666bd88653a",
"include/platform/vk_features.json":
"5266e522142d92061527d3d1ff2ecc09",
"util/angle_features_autogen.cpp":
"569685ec9c1b11dc004219eccffa75a4",
"util/angle_features_autogen.h":
"08370288b8d692fcfa3b24b8bae2bfde"
}