Skip to content

Commit

Permalink
Fix dawn tests not using CLI adapter toggles
Browse files Browse the repository at this point in the history
For example, `--disable-toggles=use_dxc` was being ignored. Use the
ParamTogglesHelper to collect all adapter toggles, as we do for device
toggles.

Note that we were previously needlessly passing in force
enabled/disabled *device* toggles in the adapter options. This no longer
happens now as ParamTogglesHelper filters the toggles by stage.

Change-Id: I439129e8e7a33f50cdefca8b810efba0c1c34fa1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/206259
Commit-Queue: Antonio Maiorano <[email protected]>
Reviewed-by: Corentin Wallez <[email protected]>
  • Loading branch information
amaiorano authored and Dawn LUCI CQ committed Sep 11, 2024
1 parent cf53d56 commit 611fbcf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/dawn/tests/DawnTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,16 +727,10 @@ DawnTestBase::DawnTestBase(const AdapterTestParam& param) : mParam(param) {
DAWN_ASSERT(callbackInfo.mode == WGPUCallbackMode_AllowSpontaneous);

// Use the required toggles of test case when creating adapter.
const auto& enabledToggles = gCurrentTest->mParam.forceEnabledWorkarounds;
const auto& disabledToggles = gCurrentTest->mParam.forceDisabledWorkarounds;
wgpu::DawnTogglesDescriptor adapterToggles;
adapterToggles.enabledToggleCount = enabledToggles.size();
adapterToggles.enabledToggles = enabledToggles.data();
adapterToggles.disabledToggleCount = disabledToggles.size();
adapterToggles.disabledToggles = disabledToggles.data();
ParamTogglesHelper deviceTogglesHelper(gCurrentTest->mParam, native::ToggleStage::Adapter);

wgpu::RequestAdapterOptions adapterOptions;
adapterOptions.nextInChain = &adapterToggles;
adapterOptions.nextInChain = &deviceTogglesHelper.togglesDesc;
adapterOptions.backendType = gCurrentTest->mParam.adapterProperties.backendType;
adapterOptions.compatibilityMode = gCurrentTest->mParam.adapterProperties.compatibilityMode;

Expand Down

0 comments on commit 611fbcf

Please sign in to comment.