summaryrefslogtreecommitdiffstats
path: root/dom/webgpu/Adapter.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/webgpu/Adapter.cpp
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/webgpu/Adapter.cpp')
-rw-r--r--dom/webgpu/Adapter.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/dom/webgpu/Adapter.cpp b/dom/webgpu/Adapter.cpp
index 434ba7c6fa..7c0e72eac4 100644
--- a/dom/webgpu/Adapter.cpp
+++ b/dom/webgpu/Adapter.cpp
@@ -128,9 +128,6 @@ static Maybe<ffi::WGPUFeatures> ToWGPUFeatures(
case dom::GPUFeatureName::Float32_filterable:
return Some(WGPUFeatures_FLOAT32_FILTERABLE);
-
- case dom::GPUFeatureName::EndGuard_:
- break;
}
MOZ_CRASH("Bad GPUFeatureName.");
}
@@ -141,11 +138,11 @@ static Maybe<ffi::WGPUFeatures> MakeFeatureBits(
for (const auto& feature : aFeatures) {
const auto bit = ToWGPUFeatures(feature);
if (!bit) {
- const auto featureStr = dom::GPUFeatureNameValues::GetString(feature);
+ const auto featureStr = dom::GetEnumString(feature);
(void)featureStr;
NS_WARNING(
nsPrintfCString("Requested feature bit for '%s' is not implemented.",
- featureStr.data())
+ featureStr.get())
.get());
return Nothing();
}
@@ -169,7 +166,7 @@ Adapter::Adapter(Instance* const aParent, WebGPUChild* const aBridge,
auto ret = std::unordered_map<ffi::WGPUFeatures, dom::GPUFeatureName>{};
for (const auto feature :
- MakeEnumeratedRange(dom::GPUFeatureName::EndGuard_)) {
+ dom::MakeWebIDLEnumeratedRange<dom::GPUFeatureName>()) {
const auto bitForFeature = ToWGPUFeatures(feature);
if (!bitForFeature) {
// There are some features that don't have bits.
@@ -363,12 +360,12 @@ already_AddRefed<dom::Promise> Adapter::RequestDevice(
for (const auto requested : aDesc.mRequiredFeatures) {
const bool supported = mFeatures->Features().count(requested);
if (!supported) {
- const auto fstr = dom::GPUFeatureNameValues::GetString(requested);
+ const auto fstr = dom::GetEnumString(requested);
const auto astr = this->LabelOrId();
nsPrintfCString msg(
"requestDevice: Feature '%s' requested must be supported by "
"adapter %s",
- fstr.data(), astr.get());
+ fstr.get(), astr.get());
promise->MaybeRejectWithTypeError(msg);
return;
}