dawn_native: Turn the DisallowUnsafeAPIs toggle on by default.

Bug: chromium:1138528
Change-Id: Iaad55e6776f3e6abcc0983ad05a1f76b0482e14c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/39504
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2021-02-01 16:22:08 +00:00 committed by Commit Bot service account
parent 1b5526457f
commit 07987ede36
3 changed files with 8 additions and 1 deletions

View File

@ -1180,6 +1180,7 @@ namespace dawn_native {
void DeviceBase::SetDefaultToggles() {
SetToggle(Toggle::LazyClearResourceOnFirstUse, true);
SetToggle(Toggle::DisallowUnsafeAPIs, true);
}
void DeviceBase::ApplyToggleOverrides(const DeviceDescriptor* deviceDescriptor) {

View File

@ -801,6 +801,9 @@ void DawnTestBase::SetUp() {
deviceDescriptor.forceDisabledToggles = mParam.forceDisabledWorkarounds;
deviceDescriptor.requiredExtensions = GetRequiredExtensions();
// Disabled disallowing unsafe APIs so we can test them.
deviceDescriptor.forceDisabledToggles.push_back("disallow_unsafe_apis");
for (const std::string& toggle : gTestEnv->GetEnabledToggles()) {
const dawn_native::ToggleInfo* info =
gTestEnv->GetInstance()->GetToggleInfo(toggle.c_str());

View File

@ -155,7 +155,10 @@ bool ValidationTest::HasToggleEnabled(const char* toggle) const {
}
WGPUDevice ValidationTest::CreateTestDevice() {
return adapter.CreateDevice();
// Disabled disallowing unsafe APIs so we can test them.
dawn_native::DeviceDescriptor deviceDescriptor;
deviceDescriptor.forceDisabledToggles.push_back("disallow_unsafe_apis");
return adapter.CreateDevice(&deviceDescriptor);
}
// static