diff --git a/generator/templates/dawn/common/Version.h b/generator/templates/dawn/common/Version.h index f9f67e726c..d8d5cdbb29 100644 --- a/generator/templates/dawn/common/Version.h +++ b/generator/templates/dawn/common/Version.h @@ -15,9 +15,11 @@ #ifndef COMMON_VERISON_AUTOGEN_H_ #define COMMON_VERISON_AUTOGEN_H_ +#include + namespace dawn { -static constexpr char kGitHash[] = "{{get_gitHash()}}"; +static constexpr std::string_view kGitHash("{{get_gitHash()}}"); } // namespace dawn diff --git a/src/dawn/native/Instance.cpp b/src/dawn/native/Instance.cpp index 8f06fb3921..3d8cce91e9 100644 --- a/src/dawn/native/Instance.cpp +++ b/src/dawn/native/Instance.cpp @@ -20,6 +20,7 @@ #include "dawn/common/GPUInfo.h" #include "dawn/common/Log.h" #include "dawn/common/SystemUtils.h" +#include "dawn/common/Version_autogen.h" #include "dawn/native/ChainUtils_autogen.h" #include "dawn/native/ErrorData.h" #include "dawn/native/Surface.h" @@ -94,9 +95,8 @@ BackendsBitset GetEnabledBackends() { } dawn::platform::CachingInterface* GetCachingInterface(dawn::platform::Platform* platform) { - if (platform != nullptr) { - return platform->GetCachingInterface(/*fingerprint*/ nullptr, - /*fingerprintSize*/ 0); + if (platform != nullptr && dawn::kGitHash.size() > 0) { + return platform->GetCachingInterface(dawn::kGitHash.data(), dawn::kGitHash.size()); } return nullptr; }