mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-06 14:43:31 +00:00
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>
This commit is contained in:
parent
97fb51f4af
commit
77fd4750ae
@ -113,26 +113,14 @@ namespace dawn_native {
|
|||||||
mImpl->EnableBackendValidation(enableBackendValidation);
|
mImpl->EnableBackendValidation(enableBackendValidation);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Instance::IsBackendValidationEnabled() const {
|
|
||||||
return mImpl->IsBackendValidationEnabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Instance::EnableBeginCaptureOnStartup(bool beginCaptureOnStartup) {
|
void Instance::EnableBeginCaptureOnStartup(bool beginCaptureOnStartup) {
|
||||||
mImpl->EnableBeginCaptureOnStartup(beginCaptureOnStartup);
|
mImpl->EnableBeginCaptureOnStartup(beginCaptureOnStartup);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Instance::IsBeginCaptureOnStartupEnabled() const {
|
|
||||||
return mImpl->IsBeginCaptureOnStartupEnabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Instance::SetPlatform(dawn_platform::Platform* platform) {
|
void Instance::SetPlatform(dawn_platform::Platform* platform) {
|
||||||
mImpl->SetPlatform(platform);
|
mImpl->SetPlatform(platform);
|
||||||
}
|
}
|
||||||
|
|
||||||
dawn_platform::Platform* Instance::GetPlatform() const {
|
|
||||||
return mImpl->GetPlatform();
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t GetLazyClearCountForTesting(WGPUDevice device) {
|
size_t GetLazyClearCountForTesting(WGPUDevice device) {
|
||||||
dawn_native::DeviceBase* deviceBase = reinterpret_cast<dawn_native::DeviceBase*>(device);
|
dawn_native::DeviceBase* deviceBase = reinterpret_cast<dawn_native::DeviceBase*>(device);
|
||||||
return deviceBase->GetLazyClearCountForTesting();
|
return deviceBase->GetLazyClearCountForTesting();
|
||||||
|
@ -140,14 +140,11 @@ namespace dawn_native {
|
|||||||
|
|
||||||
// Enable backend's validation layers if it has.
|
// Enable backend's validation layers if it has.
|
||||||
void EnableBackendValidation(bool enableBackendValidation);
|
void EnableBackendValidation(bool enableBackendValidation);
|
||||||
bool IsBackendValidationEnabled() const;
|
|
||||||
|
|
||||||
// Enable debug capture on Dawn startup
|
// Enable debug capture on Dawn startup
|
||||||
void EnableBeginCaptureOnStartup(bool beginCaptureOnStartup);
|
void EnableBeginCaptureOnStartup(bool beginCaptureOnStartup);
|
||||||
bool IsBeginCaptureOnStartupEnabled() const;
|
|
||||||
|
|
||||||
void SetPlatform(dawn_platform::Platform* platform);
|
void SetPlatform(dawn_platform::Platform* platform);
|
||||||
dawn_platform::Platform* GetPlatform() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
InstanceBase* mImpl = nullptr;
|
InstanceBase* mImpl = nullptr;
|
||||||
|
@ -175,6 +175,10 @@ const char* DawnPerfTestEnvironment::GetTraceFile() const {
|
|||||||
return mTraceFile;
|
return mTraceFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DawnPerfTestPlatform* DawnPerfTestEnvironment::GetPlatform() const {
|
||||||
|
return mPlatform.get();
|
||||||
|
}
|
||||||
|
|
||||||
DawnPerfTestBase::DawnPerfTestBase(DawnTestBase* test,
|
DawnPerfTestBase::DawnPerfTestBase(DawnTestBase* test,
|
||||||
unsigned int iterationsPerStep,
|
unsigned int iterationsPerStep,
|
||||||
unsigned int maxStepsInFlight)
|
unsigned int maxStepsInFlight)
|
||||||
@ -216,7 +220,7 @@ void DawnPerfTestBase::RunTest() {
|
|||||||
DoRunLoop(kMaximumRunTimeSeconds);
|
DoRunLoop(kMaximumRunTimeSeconds);
|
||||||
|
|
||||||
DawnPerfTestPlatform* platform =
|
DawnPerfTestPlatform* platform =
|
||||||
reinterpret_cast<DawnPerfTestPlatform*>(gTestEnv->GetInstance()->GetPlatform());
|
reinterpret_cast<DawnPerfTestPlatform*>(gTestEnv->GetPlatform());
|
||||||
const char* testName = ::testing::UnitTest::GetInstance()->current_test_info()->name();
|
const char* testName = ::testing::UnitTest::GetInstance()->current_test_info()->name();
|
||||||
|
|
||||||
// Only enable trace event recording in this section.
|
// Only enable trace event recording in this section.
|
||||||
@ -234,7 +238,7 @@ void DawnPerfTestBase::RunTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DawnPerfTestBase::DoRunLoop(double maxRunTime) {
|
void DawnPerfTestBase::DoRunLoop(double maxRunTime) {
|
||||||
dawn_platform::Platform* platform = gTestEnv->GetInstance()->GetPlatform();
|
dawn_platform::Platform* platform = gTestEnv->GetPlatform();
|
||||||
|
|
||||||
mNumStepsPerformed = 0;
|
mNumStepsPerformed = 0;
|
||||||
cpuTime = 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
|
// which waits for all threads to stop doing work. When we output results, there should
|
||||||
// be no additional incoming trace events.
|
// be no additional incoming trace events.
|
||||||
DawnPerfTestPlatform* platform =
|
DawnPerfTestPlatform* platform =
|
||||||
reinterpret_cast<DawnPerfTestPlatform*>(gTestEnv->GetInstance()->GetPlatform());
|
reinterpret_cast<DawnPerfTestPlatform*>(gTestEnv->GetPlatform());
|
||||||
|
|
||||||
std::vector<DawnPerfTestPlatform::TraceEvent> traceEventBuffer =
|
std::vector<DawnPerfTestPlatform::TraceEvent> traceEventBuffer =
|
||||||
platform->AcquireTraceEventBuffer();
|
platform->AcquireTraceEventBuffer();
|
||||||
|
@ -40,6 +40,8 @@ class DawnPerfTestEnvironment : public DawnTestEnvironment {
|
|||||||
// not be written to a json file.
|
// not be written to a json file.
|
||||||
const char* GetTraceFile() const;
|
const char* GetTraceFile() const;
|
||||||
|
|
||||||
|
DawnPerfTestPlatform* GetPlatform() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Only run calibration which allows the perf test runner to save time.
|
// Only run calibration which allows the perf test runner to save time.
|
||||||
bool mIsCalibrating = false;
|
bool mIsCalibrating = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user