summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-compiler.cpp
diff options
context:
space:
mode:
authorskallweitNV <64953474+skallweitNV@users.noreply.github.com>2022-12-12 19:25:48 +0100
committerGitHub <noreply@github.com>2022-12-12 10:25:48 -0800
commitc2dc1a86ed2f5e160749fe9f99b70db6c3e4d7a6 (patch)
treeea65b9635d892917a2420688a27c38537c4758be /source/slang/slang-compiler.cpp
parent8d359fc6133fa49d2d3b7f8bb4b37916e719c344 (diff)
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
Diffstat (limited to 'source/slang/slang-compiler.cpp')
-rw-r--r--source/slang/slang-compiler.cpp29
1 files changed, 10 insertions, 19 deletions
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<EntryPointSpecializationInfo>(specializationInfo));
}
- void EntryPoint::updateDependencyBasedHash(
- DigestBuilder<MD5>& builder,
- SlangInt entryPointIndex)
+ void EntryPoint::buildHash(DigestBuilder<SHA1>& 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<Module*> const& EntryPoint::getModuleDependencies()
@@ -242,12 +237,12 @@ namespace Slang
return empty;
}
- List<String> const& EntryPoint::getFilePathDependencies()
+ List<SourceFile*> const& EntryPoint::getFileDependencies()
{
if(auto module = getModule())
- return getModule()->getFilePathDependencies();
+ return getModule()->getFileDependencies();
- static List<String> empty;
+ static List<SourceFile*> empty;
return empty;
}
@@ -269,8 +264,8 @@ namespace Slang
if (auto declaredWitness = as<DeclaredSubtypeWitness>(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<MD5>& builder,
- SlangInt entryPointIndex)
+ void TypeConformance::buildHash(DigestBuilder<SHA1>& 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<Module*> const& TypeConformance::getModuleDependencies()
{
- return m_moduleDependency.getModuleList();
+ return m_moduleDependencyList.getModuleList();
}
- List<String> const& TypeConformance::getFilePathDependencies()
+ List<SourceFile*> const& TypeConformance::getFileDependencies()
{
- return m_pathDependency.getFilePathList();
+ return m_fileDependencyList.getFileList();
}
Index TypeConformance::getRequirementCount() { return m_requirements.getCount(); }