Add CacheRequest utilities and tests This CL adds a DAWN_MAKE_CACHE_REQUEST X macro which helps in building a CacheRequest struct. A CacheRequest struct may be passed to LoadOrRun which will generate a CacheKey from the struct and load a result if there is a cache hit, or it will call the provided cache miss function to compute a value. The request struct helps enforce that precisely the inputs that go into a computation are all also included inside the CacheKey for that computation. Bug: dawn:549 Change-Id: Id85eb95f1b944d5431f142162ffa9a384351be89 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91063 Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Austin Eng <enga@chromium.org>
diff --git a/src/dawn/tests/DawnNativeTest.h b/src/dawn/tests/DawnNativeTest.h index e92bf67..dd3532f 100644 --- a/src/dawn/tests/DawnNativeTest.h +++ b/src/dawn/tests/DawnNativeTest.h
@@ -38,12 +38,13 @@ ~DawnNativeTest() override; void SetUp() override; - void TearDown() override; + virtual std::unique_ptr<dawn::platform::Platform> CreateTestPlatform(); virtual WGPUDevice CreateTestDevice(); protected: std::unique_ptr<dawn::native::Instance> instance; + std::unique_ptr<dawn::platform::Platform> platform; dawn::native::Adapter adapter; wgpu::Device device;