From c2dc1a86ed2f5e160749fe9f99b70db6c3e4d7a6 Mon Sep 17 00:00:00 2001 From: skallweitNV <64953474+skallweitNV@users.noreply.github.com> Date: Mon, 12 Dec 2022 19:25:48 +0100 Subject: Refactor shader cache (#2558) * Fix a bug in Path::find * Fix code formatting * Fix LockFile and add LockFileGuard * Add PersistentCache and unit test * Replace file path dependency list with source file dependency list * Add note on ordering in Module/FileDependencyList * Remove old shader cache code * Refactor shader cache implementation * Temporarily skip unit tests reading/writing files * Fix warning * Reenable lock file test * Rename shader cache tests and disable crashing test * Testing * Stop using Path::getCanonical * Fix persistent cache lock and test * Fix threading issues * Move adding file dependency hashes to getEntryPointHash() * Fix handling of #include files * Allow specifying additional search paths for gfx testing device * Work on shader cache tests * Update project files * Revive shader cache graphics tests * Split graphics pipeline test * Fix compilation --- source/slang/slang-compiler.cpp | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'source/slang/slang-compiler.cpp') diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index ce0ae4085..f2ebefb9d 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -223,14 +223,9 @@ namespace Slang visitor->visitEntryPoint(this, as(specializationInfo)); } - void EntryPoint::updateDependencyBasedHash( - DigestBuilder& builder, - SlangInt entryPointIndex) + void EntryPoint::buildHash(DigestBuilder& builder) { - // CompositeComponentType will have already hashed the relevant entry point's name - // and file path dependencies, so we immediately return. SLANG_UNUSED(builder); - SLANG_UNUSED(entryPointIndex); } List const& EntryPoint::getModuleDependencies() @@ -242,12 +237,12 @@ namespace Slang return empty; } - List const& EntryPoint::getFilePathDependencies() + List const& EntryPoint::getFileDependencies() { if(auto module = getModule()) - return getModule()->getFilePathDependencies(); + return getModule()->getFileDependencies(); - static List empty; + static List empty; return empty; } @@ -269,8 +264,8 @@ namespace Slang if (auto declaredWitness = as(witness)) { auto declModule = getModule(declaredWitness->declRef.getDecl()); - m_moduleDependency.addDependency(declModule); - m_pathDependency.addDependency(declModule); + m_moduleDependencyList.addDependency(declModule); + m_fileDependencyList.addDependency(declModule); if (m_requirementSet.Add(declModule)) { m_requirements.add(declModule); @@ -301,12 +296,8 @@ namespace Slang return Super::getInterface(guid); } - void TypeConformance::updateDependencyBasedHash( - DigestBuilder& builder, - SlangInt entryPointIndex) + void TypeConformance::buildHash(DigestBuilder& builder) { - SLANG_UNUSED(entryPointIndex); - //TODO: Implement some kind of hashInto for Val then replace this auto subtypeWitness = m_subtypeWitness->toString(); @@ -316,12 +307,12 @@ namespace Slang List const& TypeConformance::getModuleDependencies() { - return m_moduleDependency.getModuleList(); + return m_moduleDependencyList.getModuleList(); } - List const& TypeConformance::getFilePathDependencies() + List const& TypeConformance::getFileDependencies() { - return m_pathDependency.getFilePathList(); + return m_fileDependencyList.getFileList(); } Index TypeConformance::getRequirementCount() { return m_requirements.getCount(); } -- cgit v1.2.3