Combine tint toggles.

This CL combines the use tint inspector and use tint generator toggles.

Change-Id: Idcfe0ffa1ddbdf0e240dd8d502d0a164018a6e1b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/39142
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair 2021-01-28 15:02:35 +00:00 committed by Commit Bot service account
parent 05045e0ad8
commit dc25c98727
2 changed files with 9 additions and 1 deletions

View File

@ -1160,7 +1160,7 @@ namespace dawn_native {
#endif
}
if (GetDevice()->IsToggleEnabled(Toggle::UseTintInspector)) {
if (GetDevice()->IsToggleEnabled(Toggle::UseTintGenerator)) {
#ifdef DAWN_ENABLE_WGSL
tint::Program localProgram;

View File

@ -163,12 +163,20 @@ namespace dawn_native {
void TogglesSet::Set(Toggle toggle, bool enabled) {
ASSERT(toggle != Toggle::InvalidEnum);
if (toggle == Toggle::UseTintInspector)
toggle = Toggle::UseTintGenerator;
const size_t toggleIndex = static_cast<size_t>(toggle);
toggleBitset.set(toggleIndex, enabled);
}
bool TogglesSet::Has(Toggle toggle) const {
ASSERT(toggle != Toggle::InvalidEnum);
if (toggle == Toggle::UseTintInspector)
toggle = Toggle::UseTintGenerator;
const size_t toggleIndex = static_cast<size_t>(toggle);
return toggleBitset.test(toggleIndex);
}