Dawn: Rename remaining DiscoverAdapters to DiscoverPhysicalDevices

This CL rename the remaining DiscoverAdapter names to
DiscoverPhysicalDevices.

Bug: dawn:1774
Change-Id: I417ef2d1e02c98a61bb48c3c7251a031380c9233
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/134420
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This commit is contained in:
Zhaoming Jiang 2023-05-26 09:27:20 +00:00 committed by Dawn LUCI CQ
parent 52586334c2
commit 2ef42221d4
6 changed files with 10 additions and 10 deletions

View File

@ -64,9 +64,9 @@ namespace DawnLPMFuzzer {
int Initialize(int* argc, char*** argv) {
// TODO(crbug.com/1038952): The Instance must be static because destructing the vkInstance with
// Swiftshader crashes libFuzzer. When this is fixed, move this into Run so that error injection
// for adapter discovery can be fuzzed.
// for physical device discovery can be fuzzed.
sInstance = std::make_unique<dawn::native::Instance>();
sInstance->DiscoverDefaultAdapters();
sInstance->DiscoverDefaultPhysicalDevices();
return 0;
}

View File

@ -105,7 +105,7 @@ GPU::GPU(Flags flags) : flags_(std::move(flags)) {
if (auto dir = flags_.Get("dlldir")) {
SetDllDir(dir->c_str());
}
instance_.DiscoverDefaultAdapters();
instance_.DiscoverDefaultPhysicalDevices();
}
interop::Promise<std::optional<interop::Interface<interop::GPUAdapter>>> GPU::requestAdapter(

View File

@ -185,7 +185,7 @@ DawnTestEnvironment::DawnTestEnvironment(int argc, char** argv) {
// because the Vulkan validation layers use static global mutexes which behave badly when
// Chromium's test launcher forks the test process. The instance will be recreated on test
// environment setup.
std::unique_ptr<dawn::native::Instance> instance = CreateInstanceAndDiscoverAdapters();
std::unique_ptr<dawn::native::Instance> instance = CreateInstanceAndDiscoverPhysicalDevices();
ASSERT(instance);
if (!ValidateToggles(instance.get())) {
@ -377,8 +377,8 @@ void DawnTestEnvironment::ParseArgs(int argc, char** argv) {
}
}
std::unique_ptr<dawn::native::Instance> DawnTestEnvironment::CreateInstanceAndDiscoverAdapters(
dawn::platform::Platform* platform) {
std::unique_ptr<dawn::native::Instance>
DawnTestEnvironment::CreateInstanceAndDiscoverPhysicalDevices(dawn::platform::Platform* platform) {
// Create an instance with toggle AllowUnsafeAPIs enabled, which would be inherited to
// adapter and device toggles and allow us to test unsafe apis (including experimental
// features).
@ -623,7 +623,7 @@ void DawnTestEnvironment::PrintTestConfigurationAndAdapterInfo(
}
void DawnTestEnvironment::SetUp() {
mInstance = CreateInstanceAndDiscoverAdapters();
mInstance = CreateInstanceAndDiscoverPhysicalDevices();
ASSERT(mInstance);
}

View File

@ -183,7 +183,7 @@ class DawnTestEnvironment : public testing::Environment {
bool RunSuppressedTests() const;
protected:
std::unique_ptr<dawn::native::Instance> CreateInstanceAndDiscoverAdapters(
std::unique_ptr<dawn::native::Instance> CreateInstanceAndDiscoverPhysicalDevices(
dawn::platform::Platform* platform = nullptr);
std::unique_ptr<dawn::native::Instance> mInstance;

View File

@ -87,7 +87,7 @@ TEST_P(ExperimentalDP4aTests, BasicDP4aFeaturesTest) {
IsDP4aSupportedOnAdapter() &&
// Proper toggle, allow_unsafe_apis and use_dxc if d3d12
// Note that "allow_unsafe_apis" is always enabled in
// DawnTestEnvironment::CreateInstanceAndDiscoverAdapters.
// DawnTestEnvironment::CreateInstanceAndDiscoverPhysicalDevices.
HasToggleEnabled("allow_unsafe_apis") && UseDxcEnabledOrNonD3D12();
const bool deviceSupportDP4AFeature =
device.HasFeature(wgpu::FeatureName::ChromiumExperimentalDp4a);

View File

@ -123,7 +123,7 @@ DawnPerfTestEnvironment::~DawnPerfTestEnvironment() = default;
void DawnPerfTestEnvironment::SetUp() {
mPlatform = std::make_unique<DawnPerfTestPlatform>();
mInstance = CreateInstanceAndDiscoverAdapters(mPlatform.get());
mInstance = CreateInstanceAndDiscoverPhysicalDevices(mPlatform.get());
ASSERT(mInstance);
// Begin writing the trace event array.