Replace remaining std::unordered_set with absl
Bug: 42240488
Change-Id: Ib7d9c75c4a4f40988ef9c4b3ba77d62ad7d78abb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/187581
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
diff --git a/src/dawn/native/Device.cpp b/src/dawn/native/Device.cpp
index 3bdcc40..91df190 100644
--- a/src/dawn/native/Device.cpp
+++ b/src/dawn/native/Device.cpp
@@ -1765,7 +1765,8 @@
// mAdapter is not set for mock test devices.
// TODO(crbug.com/dawn/1702): using a mock adapter and instance could avoid the null checking.
if (mAdapter != nullptr) {
- mWGSLAllowedFeatures.features = GetInstance()->GetAllowedWGSLLanguageFeatures();
+ const auto& allowedFeatures = GetInstance()->GetAllowedWGSLLanguageFeatures();
+ mWGSLAllowedFeatures.features = {allowedFeatures.begin(), allowedFeatures.end()};
}
}
diff --git a/src/dawn/native/Instance.cpp b/src/dawn/native/Instance.cpp
index beb67c6..543b133 100644
--- a/src/dawn/native/Instance.cpp
+++ b/src/dawn/native/Instance.cpp
@@ -634,7 +634,7 @@
return ReturnToAPI(AcquireRef(new Surface(this, unpacked)));
}
-const std::unordered_set<tint::wgsl::LanguageFeature>&
+const absl::flat_hash_set<tint::wgsl::LanguageFeature>&
InstanceBase::GetAllowedWGSLLanguageFeatures() const {
return mTintLanguageFeatures;
}
diff --git a/src/dawn/native/Instance.h b/src/dawn/native/Instance.h
index 830083d..5ad5858 100644
--- a/src/dawn/native/Instance.h
+++ b/src/dawn/native/Instance.h
@@ -32,7 +32,6 @@
#include <memory>
#include <mutex>
#include <string>
-#include <unordered_set>
#include <vector>
#include "absl/container/flat_hash_set.h"
@@ -107,7 +106,7 @@
}
const TogglesState& GetTogglesState() const;
- const std::unordered_set<tint::wgsl::LanguageFeature>& GetAllowedWGSLLanguageFeatures() const;
+ const absl::flat_hash_set<tint::wgsl::LanguageFeature>& GetAllowedWGSLLanguageFeatures() const;
// Used to query the details of a toggle. Return nullptr if toggleName is not a valid name
// of a toggle supported in Dawn.
@@ -212,8 +211,7 @@
TogglesInfo mTogglesInfo;
absl::flat_hash_set<wgpu::WGSLFeatureName> mWGSLFeatures;
- // TODO(dawn:1513): Use absl::flat_hash_set after it is supported in Tint.
- std::unordered_set<tint::wgsl::LanguageFeature> mTintLanguageFeatures;
+ absl::flat_hash_set<tint::wgsl::LanguageFeature> mTintLanguageFeatures;
#if defined(DAWN_USE_X11)
std::unique_ptr<X11Functions> mX11Functions;