@@ -26,7 +26,6 @@ IShaderCompiler::IShaderCompiler(core::smart_refctd_ptr<system::ISystem>&& syste
26
26
core::smart_refctd_ptr<ICPUShader> nbl::asset::IShaderCompiler::compileToSPIRV (const std::string_view code, const SCompilerOptions& options) const
27
27
{
28
28
CCache::SEntry entry;
29
- std::vector<CCache::SEntry::SPreprocessingDependency> dependencies;
30
29
if (options.readCache || options.writeCache )
31
30
entry = CCache::SEntry (code, options);
32
31
@@ -44,7 +43,7 @@ core::smart_refctd_ptr<ICPUShader> nbl::asset::IShaderCompiler::compileToSPIRV(c
44
43
}
45
44
}
46
45
47
- auto retVal = compileToSPIRV_impl (code, options, options.writeCache ? &dependencies : nullptr );
46
+ auto retVal = compileToSPIRV_impl (code, options, options.writeCache ? &entry. dependencies : nullptr );
48
47
// compute the SPIR-V shader content hash
49
48
{
50
49
auto backingBuffer = retVal->getContent ();
@@ -53,7 +52,7 @@ core::smart_refctd_ptr<ICPUShader> nbl::asset::IShaderCompiler::compileToSPIRV(c
53
52
54
53
if (options.writeCache )
55
54
{
56
- if (entry.setContent (retVal->getContent (), std::move (dependencies) ))
55
+ if (entry.setContent (retVal->getContent ()))
57
56
options.writeCache ->insert (std::move (entry));
58
57
}
59
58
return retVal;
@@ -272,19 +271,19 @@ IShaderCompiler::CCache::EntrySet::const_iterator IShaderCompiler::CCache::find_
272
271
auto found = m_container.find (mainFile);
273
272
// go through all dependencies
274
273
if (found!=m_container.end ())
275
- for (auto i = 0 ; i < found->dependencies .size (); i++)
276
274
{
277
- const auto & dependency = found->dependencies [i];
278
-
279
- IIncludeLoader::found_t header;
280
- if (dependency.standardInclude )
281
- header = finder->getIncludeStandard (dependency.requestingSourceDir , dependency.identifier );
282
- else
283
- header = finder->getIncludeRelative (dependency.requestingSourceDir , dependency.identifier );
284
-
285
- if (header.hash != dependency.hash )
275
+ for (const auto & dependency : found->dependencies )
286
276
{
287
- return m_container.end ();
277
+ IIncludeLoader::found_t header;
278
+ if (dependency.standardInclude )
279
+ header = finder->getIncludeStandard (dependency.requestingSourceDir , dependency.identifier );
280
+ else
281
+ header = finder->getIncludeRelative (dependency.requestingSourceDir , dependency.identifier );
282
+
283
+ if (header.hash != dependency.hash )
284
+ {
285
+ return m_container.end ();
286
+ }
288
287
}
289
288
}
290
289
@@ -393,9 +392,8 @@ core::smart_refctd_ptr<IShaderCompiler::CCache> IShaderCompiler::CCache::deseria
393
392
static void * SzAlloc (ISzAllocPtr p, size_t size) { p = p; return _NBL_ALIGNED_MALLOC (size, _NBL_SIMD_ALIGNMENT); }
394
393
static void SzFree (ISzAllocPtr p, void * address) { p = p; _NBL_ALIGNED_FREE (address); }
395
394
396
- bool nbl::asset::IShaderCompiler::CCache::SEntry::setContent (const asset::ICPUBuffer* uncompressedSpirvBuffer, dependency_container_t && dependencies )
395
+ bool nbl::asset::IShaderCompiler::CCache::SEntry::setContent (const asset::ICPUBuffer* uncompressedSpirvBuffer)
397
396
{
398
- dependencies = std::move (dependencies);
399
397
uncompressedContentHash = uncompressedSpirvBuffer->getContentHash ();
400
398
uncompressedSize = uncompressedSpirvBuffer->getSize ();
401
399
0 commit comments