diff --git a/src/dawn_native/Adapter.cpp b/src/dawn_native/Adapter.cpp index c311df0b0d..61912f4015 100644 --- a/src/dawn_native/Adapter.cpp +++ b/src/dawn_native/Adapter.cpp @@ -121,8 +121,12 @@ namespace dawn_native { MaybeError AdapterBase::CreateDeviceInternal(DeviceBase** result, const DeviceDescriptor* descriptor) { if (descriptor != nullptr) { - if (!SupportsAllRequestedExtensions(descriptor->requiredExtensions)) { - return DAWN_VALIDATION_ERROR("One or more requested extensions are not supported"); + for (const char* extensionStr : descriptor->requiredExtensions) { + Extension extensionEnum = mInstance->ExtensionNameToEnum(extensionStr); + DAWN_INVALID_IF(extensionEnum == Extension::InvalidEnum, + "Requested feature %s is unknown.", extensionStr); + DAWN_INVALID_IF(!mSupportedExtensions.IsEnabled(extensionEnum), + "Requested feature %s is disabled.", extensionStr); } } @@ -131,9 +135,8 @@ namespace dawn_native { mUseTieredLimits ? ApplyLimitTiers(mLimits.v1) : mLimits.v1, reinterpret_cast(descriptor->requiredLimits)->limits)); - if (descriptor->requiredLimits->nextInChain != nullptr) { - return DAWN_VALIDATION_ERROR("Unsupported limit extension struct"); - } + DAWN_INVALID_IF(descriptor->requiredLimits->nextInChain != nullptr, + "nextInChain is not nullptr."); } DAWN_TRY_ASSIGN(*result, CreateDeviceImpl(descriptor));