dawn.node: Propagate toggles to the instance creation.
This is necessary for it to see allow_unsafe_apis and expose the unsafe
wgslLanguageFeatures for testing with run-cts
Bug: dawn:2260
Change-Id: I5695090ac03a303d3074bee312728af0cf22ac62
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/166146
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn/node/binding/GPU.cpp b/src/dawn/node/binding/GPU.cpp
index 411446c..2e247c5 100644
--- a/src/dawn/node/binding/GPU.cpp
+++ b/src/dawn/node/binding/GPU.cpp
@@ -124,8 +124,12 @@
dawnDesc.backendValidationLevel = dawn::native::BackendValidationLevel::Full;
}
+ TogglesLoader togglesLoader(flags_);
+ DawnTogglesDescriptor togglesDesc = togglesLoader.GetDescriptor();
+ togglesDesc.nextInChain = &dawnDesc;
+
wgpu::InstanceDescriptor desc;
- desc.nextInChain = &dawnDesc;
+ desc.nextInChain = &togglesDesc;
instance_ = std::make_unique<dawn::native::Instance>(
reinterpret_cast<const WGPUInstanceDescriptor*>(&desc));
}