mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1932738 - fix(webgpu): prioritize Firefox-unimplemented feature errors over adapter lack-of-support errors r=webgpu-reviewers,teoxoy
Differential Revision: https://phabricator.services.mozilla.com/D229828
This commit is contained in:
parent
63fa5e7544
commit
858d3f15e6
@ -342,18 +342,6 @@ already_AddRefed<dom::Promise> Adapter::RequestDevice(
|
||||
|
||||
ffi::WGPUFeatures featureBits = 0;
|
||||
for (const auto requested : aDesc.mRequiredFeatures) {
|
||||
const bool supportedByAdapter = mFeatures->Features().count(requested);
|
||||
if (!supportedByAdapter) {
|
||||
const auto fstr = dom::GetEnumString(requested);
|
||||
const auto astr = this->LabelOrId();
|
||||
nsPrintfCString msg(
|
||||
"`GPUAdapter.requestDevice`: '%s' was requested in "
|
||||
"`requiredFeatures`, but it is not supported by adapter %s.",
|
||||
fstr.get(), astr.get());
|
||||
promise->MaybeRejectWithTypeError(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto bit = ToWGPUFeatures(requested);
|
||||
if (!bit) {
|
||||
const auto featureStr = dom::GetEnumString(requested);
|
||||
@ -366,6 +354,18 @@ already_AddRefed<dom::Promise> Adapter::RequestDevice(
|
||||
return;
|
||||
}
|
||||
featureBits |= *bit;
|
||||
|
||||
const bool supportedByAdapter = mFeatures->Features().count(requested);
|
||||
if (!supportedByAdapter) {
|
||||
const auto fstr = dom::GetEnumString(requested);
|
||||
const auto astr = this->LabelOrId();
|
||||
nsPrintfCString msg(
|
||||
"`GPUAdapter.requestDevice`: '%s' was requested in "
|
||||
"`requiredFeatures`, but it is not supported by adapter %s.",
|
||||
fstr.get(), astr.get());
|
||||
promise->MaybeRejectWithTypeError(msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// -
|
||||
|
Loading…
Reference in New Issue
Block a user