Skip to content

Commit f3f4344

Browse files
author
devsh
committed
make the shader compilers compute a hash of their outputs
1 parent c94a615 commit f3f4344

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/nbl/asset/utils/IShaderCompiler.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,11 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
442442
return found;
443443
}
444444
auto retVal = compileToSPIRV_impl(code, options, options.writeCache ? &dependencies : nullptr);
445+
// compute the SPIR-V shader content hash
446+
{
447+
auto backingBuffer = retVal->getContent();
448+
const_cast<ICPUBuffer*>(backingBuffer)->setContentHash(backingBuffer->computeContentHash());
449+
}
445450
if (options.writeCache)
446451
{
447452
entry.dependencies = std::move(dependencies);

0 commit comments

Comments
 (0)