MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / hasValidCache

Method hasValidCache

Source/Falcor/Scene/SceneCache.cpp:218–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216 };
217
218 bool SceneCache::hasValidCache(const Key& key)
219 {
220 auto cachePath = getCachePath(key);
221 if (!std::filesystem::exists(cachePath)) return false;
222
223 // Open file.
224 std::ifstream fs(cachePath.c_str(), std::ios_base::binary);
225 if (fs.bad()) return false;
226
227 // Verify header.
228 Header header;
229 fs.read(reinterpret_cast<char*>(&header), sizeof(header));
230 return !fs.eof() && header.isValid();
231 }
232
233 void SceneCache::writeCache(const Scene::SceneData& sceneData, const Key& key)
234 {

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected