Instance: Only discover default adapters once.
BUG=dawn:109 Change-Id: I9e54550dc8d3cdea289b3ad529a69a4cf3d5a35b Reviewed-on: https://dawn-review.googlesource.com/c/5040 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
b92fa10557
commit
9b8d2b0bbf
|
@ -54,6 +54,10 @@ namespace dawn_native {
|
|||
void InstanceBase::DiscoverDefaultAdapters() {
|
||||
EnsureBackendConnections();
|
||||
|
||||
if (mDiscoveredDefaultAdapters) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Query and merge all default adapters for all backends
|
||||
for (std::unique_ptr<BackendConnection>& backend : mBackends) {
|
||||
std::vector<std::unique_ptr<AdapterBase>> backendAdapters =
|
||||
|
@ -65,6 +69,8 @@ namespace dawn_native {
|
|||
mAdapters.push_back(std::move(adapter));
|
||||
}
|
||||
}
|
||||
|
||||
mDiscoveredDefaultAdapters = true;
|
||||
}
|
||||
|
||||
// This is just a wrapper around the real logic that uses Error.h error handling.
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace dawn_native {
|
|||
MaybeError DiscoverAdaptersInternal(const AdapterDiscoveryOptionsBase* options);
|
||||
|
||||
bool mBackendsConnected = false;
|
||||
bool mDiscoveredDefaultAdapters = false;
|
||||
|
||||
std::vector<std::unique_ptr<BackendConnection>> mBackends;
|
||||
std::vector<std::unique_ptr<AdapterBase>> mAdapters;
|
||||
|
|
Loading…
Reference in New Issue