From 8add41a6e37994577d928bc312801ddfa1c33173 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Mon, 17 Oct 2022 17:38:59 -0700 Subject: Shader cache index implementation (#2452) --- tools/gfx/renderer-shared.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/gfx/renderer-shared.cpp') diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp index f76fa2325..48cd6907f 100644 --- a/tools/gfx/renderer-shared.cpp +++ b/tools/gfx/renderer-shared.cpp @@ -6,7 +6,7 @@ #include "../../source/core/slang-file-system.h" #include "../../slang.h" -#include "../../source/slang/slang-hash-utils.h" +#include "../../source/core/slang-digest-util.h" using namespace Slang; @@ -368,7 +368,7 @@ Result RendererBase::getEntryPointCodeFromShaderCache( slang::Digest shaderKeyHash; program->computeDependencyBasedHash(entryPointIndex, targetIndex, &shaderKeyHash); - StringBuilder shaderKey = hashToString(shaderKeyHash); + String shaderKey = DigestUtil::toString(shaderKeyHash); // Produce a hash using the AST for this program - This is needed to check whether a cache entry is effectively dirty, // or to save along with the compiled code into an entry so the entry can be checked if fetched later on. @@ -463,6 +463,9 @@ IDevice* gfx::RendererBase::getInterface(const Guid& guid) SLANG_NO_THROW Result SLANG_MCALL RendererBase::initialize(const Desc& desc) { + // TODO: This logic for initalizing the shader cache has been replicated inside + // the constructor for ShaderCacheIndex. Remove when ShaderCacheIndex is integrated in. + // If a shader cache file system was provided, use the provided system. if (desc.shaderCacheFileSystem) { -- cgit v1.2.3