Remove unnecessary getters from dawn_native::Instance.
As part of moving to webgpu.h's version of the Instance, the setters
will be replaced with a descriptor, and getters don't usually exists for
things set with descriptors (except getBindGroupLayout).
BUG=dawn:22
Change-Id: I05be8ebf241b33d019d521e40bfef8e49cdab07d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14540
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/DawnNative.cpp b/src/dawn_native/DawnNative.cpp
index 45fbb55..f058d78 100644
--- a/src/dawn_native/DawnNative.cpp
+++ b/src/dawn_native/DawnNative.cpp
@@ -113,26 +113,14 @@
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<dawn_native::DeviceBase*>(device);
return deviceBase->GetLazyClearCountForTesting();
diff --git a/src/include/dawn_native/DawnNative.h b/src/include/dawn_native/DawnNative.h
index b9a1d0e..61fc0c0 100644
--- a/src/include/dawn_native/DawnNative.h
+++ b/src/include/dawn_native/DawnNative.h
@@ -140,14 +140,11 @@
// 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 2971a4d..8fd3ab8 100644
--- a/src/tests/perf_tests/DawnPerfTest.cpp
+++ b/src/tests/perf_tests/DawnPerfTest.cpp
@@ -175,6 +175,10 @@
return mTraceFile;
}
+DawnPerfTestPlatform* DawnPerfTestEnvironment::GetPlatform() const {
+ return mPlatform.get();
+}
+
DawnPerfTestBase::DawnPerfTestBase(DawnTestBase* test,
unsigned int iterationsPerStep,
unsigned int maxStepsInFlight)
@@ -216,7 +220,7 @@
DoRunLoop(kMaximumRunTimeSeconds);
DawnPerfTestPlatform* platform =
- reinterpret_cast<DawnPerfTestPlatform*>(gTestEnv->GetInstance()->GetPlatform());
+ reinterpret_cast<DawnPerfTestPlatform*>(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::DoRunLoop(double maxRunTime) {
- dawn_platform::Platform* platform = gTestEnv->GetInstance()->GetPlatform();
+ dawn_platform::Platform* platform = gTestEnv->GetPlatform();
mNumStepsPerformed = 0;
cpuTime = 0;
@@ -285,7 +289,7 @@
// 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<DawnPerfTestPlatform*>(gTestEnv->GetInstance()->GetPlatform());
+ reinterpret_cast<DawnPerfTestPlatform*>(gTestEnv->GetPlatform());
std::vector<DawnPerfTestPlatform::TraceEvent> traceEventBuffer =
platform->AcquireTraceEventBuffer();
diff --git a/src/tests/perf_tests/DawnPerfTest.h b/src/tests/perf_tests/DawnPerfTest.h
index f6859d1..b514b1c 100644
--- a/src/tests/perf_tests/DawnPerfTest.h
+++ b/src/tests/perf_tests/DawnPerfTest.h
@@ -40,6 +40,8 @@
// 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;