diff --git a/src/dawn_native/DawnNative.cpp b/src/dawn_native/DawnNative.cpp index 45fbb55ad9..f058d785a7 100644 --- a/src/dawn_native/DawnNative.cpp +++ b/src/dawn_native/DawnNative.cpp @@ -113,26 +113,14 @@ namespace dawn_native { mImpl->EnableBackendValidation(enableBackendValidation); } - bool Instance::IsBackendValidationEnabled() const { - return mImpl->IsBackendValidationEnabled(); - } - void Instance::EnableBeginCaptureOnStartup(bool beginCaptureOnStartup) { mImpl->EnableBeginCaptureOnStartup(beginCaptureOnStartup); } - bool Instance::IsBeginCaptureOnStartupEnabled() const { - return mImpl->IsBeginCaptureOnStartupEnabled(); - } - void Instance::SetPlatform(dawn_platform::Platform* platform) { mImpl->SetPlatform(platform); } - dawn_platform::Platform* Instance::GetPlatform() const { - return mImpl->GetPlatform(); - } - size_t GetLazyClearCountForTesting(WGPUDevice device) { dawn_native::DeviceBase* deviceBase = reinterpret_cast(device); return deviceBase->GetLazyClearCountForTesting(); diff --git a/src/include/dawn_native/DawnNative.h b/src/include/dawn_native/DawnNative.h index b9a1d0eaee..61fc0c0f96 100644 --- a/src/include/dawn_native/DawnNative.h +++ b/src/include/dawn_native/DawnNative.h @@ -140,14 +140,11 @@ namespace dawn_native { // Enable backend's validation layers if it has. void EnableBackendValidation(bool enableBackendValidation); - bool IsBackendValidationEnabled() const; // Enable debug capture on Dawn startup void EnableBeginCaptureOnStartup(bool beginCaptureOnStartup); - bool IsBeginCaptureOnStartupEnabled() const; void SetPlatform(dawn_platform::Platform* platform); - dawn_platform::Platform* GetPlatform() const; private: InstanceBase* mImpl = nullptr; diff --git a/src/tests/perf_tests/DawnPerfTest.cpp b/src/tests/perf_tests/DawnPerfTest.cpp index 2971a4dcd9..8fd3ab8980 100644 --- a/src/tests/perf_tests/DawnPerfTest.cpp +++ b/src/tests/perf_tests/DawnPerfTest.cpp @@ -175,6 +175,10 @@ const char* DawnPerfTestEnvironment::GetTraceFile() const { return mTraceFile; } +DawnPerfTestPlatform* DawnPerfTestEnvironment::GetPlatform() const { + return mPlatform.get(); +} + DawnPerfTestBase::DawnPerfTestBase(DawnTestBase* test, unsigned int iterationsPerStep, unsigned int maxStepsInFlight) @@ -216,7 +220,7 @@ void DawnPerfTestBase::RunTest() { DoRunLoop(kMaximumRunTimeSeconds); DawnPerfTestPlatform* platform = - reinterpret_cast(gTestEnv->GetInstance()->GetPlatform()); + reinterpret_cast(gTestEnv->GetPlatform()); const char* testName = ::testing::UnitTest::GetInstance()->current_test_info()->name(); // Only enable trace event recording in this section. @@ -234,7 +238,7 @@ void DawnPerfTestBase::RunTest() { } void DawnPerfTestBase::DoRunLoop(double maxRunTime) { - dawn_platform::Platform* platform = gTestEnv->GetInstance()->GetPlatform(); + dawn_platform::Platform* platform = gTestEnv->GetPlatform(); mNumStepsPerformed = 0; cpuTime = 0; @@ -285,7 +289,7 @@ void DawnPerfTestBase::OutputResults() { // which waits for all threads to stop doing work. When we output results, there should // be no additional incoming trace events. DawnPerfTestPlatform* platform = - reinterpret_cast(gTestEnv->GetInstance()->GetPlatform()); + reinterpret_cast(gTestEnv->GetPlatform()); std::vector traceEventBuffer = platform->AcquireTraceEventBuffer(); diff --git a/src/tests/perf_tests/DawnPerfTest.h b/src/tests/perf_tests/DawnPerfTest.h index f6859d138d..b514b1c278 100644 --- a/src/tests/perf_tests/DawnPerfTest.h +++ b/src/tests/perf_tests/DawnPerfTest.h @@ -40,6 +40,8 @@ class DawnPerfTestEnvironment : public DawnTestEnvironment { // not be written to a json file. const char* GetTraceFile() const; + DawnPerfTestPlatform* GetPlatform() const; + private: // Only run calibration which allows the perf test runner to save time. bool mIsCalibrating = false;