Use git hash as fingerprint for getting caching interfaces.
- Also changes to use string_view for the constexpr hash. Bug: dawn:549 Change-Id: I1ded4994d501f0378d3fa8f5c16d07e3c566270f Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/92962 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Loko Kung <lokokung@google.com>
This commit is contained in:
parent
84bf4226d8
commit
af510d7c6a
|
@ -15,9 +15,11 @@
|
|||
#ifndef COMMON_VERISON_AUTOGEN_H_
|
||||
#define COMMON_VERISON_AUTOGEN_H_
|
||||
|
||||
#include <string_view>
|
||||
|
||||
namespace dawn {
|
||||
|
||||
static constexpr char kGitHash[] = "{{get_gitHash()}}";
|
||||
static constexpr std::string_view kGitHash("{{get_gitHash()}}");
|
||||
|
||||
} // namespace dawn
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue