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) { int Initialize(int* argc, char*** argv) {
// TODO(crbug.com/1038952): The Instance must be static because destructing the vkInstance with // 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 // 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 = std::make_unique<dawn::native::Instance>();
sInstance->DiscoverDefaultAdapters(); sInstance->DiscoverDefaultPhysicalDevices();
return 0; return 0;
} }

View File

@ -105,7 +105,7 @@ GPU::GPU(Flags flags) : flags_(std::move(flags)) {
if (auto dir = flags_.Get("dlldir")) { if (auto dir = flags_.Get("dlldir")) {
SetDllDir(dir->c_str()); SetDllDir(dir->c_str());
} }
instance_.DiscoverDefaultAdapters(); instance_.DiscoverDefaultPhysicalDevices();
} }
interop::Promise<std::optional<interop::Interface<interop::GPUAdapter>>> GPU::requestAdapter( 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 // 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 // Chromium's test launcher forks the test process. The instance will be recreated on test
// environment setup. // environment setup.
std::unique_ptr<dawn::native::Instance> instance = CreateInstanceAndDiscoverAdapters(); std::unique_ptr<dawn::native::Instance> instance = CreateInstanceAndDiscoverPhysicalDevices();
ASSERT(instance); ASSERT(instance);
if (!ValidateToggles(instance.get())) { if (!ValidateToggles(instance.get())) {
@ -377,8 +377,8 @@ void DawnTestEnvironment::ParseArgs(int argc, char** argv) {
} }
} }
std::unique_ptr<dawn::native::Instance> DawnTestEnvironment::CreateInstanceAndDiscoverAdapters( std::unique_ptr<dawn::native::Instance>
dawn::platform::Platform* platform) { DawnTestEnvironment::CreateInstanceAndDiscoverPhysicalDevices(dawn::platform::Platform* platform) {
// Create an instance with toggle AllowUnsafeAPIs enabled, which would be inherited to // 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 // adapter and device toggles and allow us to test unsafe apis (including experimental
// features). // features).
@ -623,7 +623,7 @@ void DawnTestEnvironment::PrintTestConfigurationAndAdapterInfo(
} }
void DawnTestEnvironment::SetUp() { void DawnTestEnvironment::SetUp() {
mInstance = CreateInstanceAndDiscoverAdapters(); mInstance = CreateInstanceAndDiscoverPhysicalDevices();
ASSERT(mInstance); ASSERT(mInstance);
} }

View File

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

View File

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

View File

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