MCPcopy Create free account
hub / github.com/GaijinEntertainment/DagorEngine / find

Method find

prog/tools/ShaderCompiler2/shaderBytecodeCache.cpp:73–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73ShaderBytecodeCache::LookupResult ShaderBytecodeCache::find(const CryptoHash &code_digest, const CryptoHash &const_digest,
74 const char *entry, const char *profile)
75{
76 ShaderBytecodeCache::LookupResult res{};
77 for (int i = int(cacheEntries.size() - 1); i >= 0; i--)
78 if (cacheEntries[i].codeDigest == code_digest)
79 {
80 ShaderCacheEntry &e = cacheEntries[i];
81 for (int j = e.lv2.size() - 1; j >= 0; j--)
82 if (e.lv2[j].constDigest == const_digest)
83 {
84 ShaderCacheEntry::Level2 &l2 = e.lv2[j];
85 for (int k = l2.lv3.size() - 1; k >= 0; k--)
86 if (l2.lv3[k].entry == entry && l2.lv3[k].profile == profile)
87 return {l2.lv3[k].codeIdx, {i, j, k}};
88
89 return {ShaderCacheIndex::EMPTY, {i, j, l2.addEntry(entry, profile)}};
90 }
91 return {ShaderCacheIndex::EMPTY, {i, e.addEntry(const_digest, entry, profile), 0}};
92 }
93
94 ShaderCacheEntry &e = cacheEntries.push_back();
95 e.codeDigest = code_digest;
96 return {ShaderCacheIndex::EMPTY, {int(cacheEntries.size() - 1), e.addEntry(const_digest, entry, profile), 0}};
97}
98
99void ShaderBytecodeCache::resolvePendingPasses()
100{

Callers 15

addPreDefineMethod · 0.45
addIncludeDirFromFileMethod · 0.45
updateMethod · 0.45
addIncludeMethod · 0.45
lineFunction · 0.45
upd_cmp_i_pathFunction · 0.45
upd_cmp_e_pathFunction · 0.45
upd_imp_filepathFunction · 0.45
upd_imp_dirpathFunction · 0.45
upd_exp_pathFunction · 0.45
executeMethod · 0.45
parse_blk_lineFunction · 0.45

Calls 3

sizeMethod · 0.45
addEntryMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected