Remove the ForceWGSLStep toggle.

It is no longer useful since now everything goes through the Tint AST
(and SPIRV-Cross is long gone).

Bug: dawn:960
Change-Id: I88f6017fae926eede48876fd7cd558daf0a0a869
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/149760
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/native/ShaderModule.cpp b/src/dawn/native/ShaderModule.cpp
index afd98cd..41b66a8 100644
--- a/src/dawn/native/ShaderModule.cpp
+++ b/src/dawn/native/ShaderModule.cpp
@@ -955,30 +955,9 @@
             const auto* spirvOptions =
                 std::get<const DawnShaderModuleSPIRVOptionsDescriptor*>(unpacked);
 
-            // We have a temporary toggle to force the SPIRV ingestion to go through a WGSL
-            // intermediate step. It is done by switching the spirvDesc for a wgslDesc below.
-            if (device->IsToggleEnabled(Toggle::ForceWGSLStep)) {
-#if TINT_BUILD_WGSL_WRITER
-                std::vector<uint32_t> spirv(spirvDesc->code, spirvDesc->code + spirvDesc->codeSize);
-                tint::Program program;
-                DAWN_TRY_ASSIGN(program, ParseSPIRV(spirv, outMessages, spirvOptions));
-
-                tint::wgsl::writer::Options options;
-                auto result = tint::wgsl::writer::Generate(&program, options);
-                DAWN_INVALID_IF(!result, "Tint WGSL failure: Generator: %s", result.Failure());
-
-                newWgslCode = std::move(result->wgsl);
-                newWgslDesc.code = newWgslCode.c_str();
-                wgslDesc = &newWgslDesc;
-                break;
-#else
-                device->EmitLog(WGPULoggingType_Info,
-                                "Toggle::ForceWGSLStep skipped because TINT_BUILD_WGSL_WRITER is "
-                                "not defined\n");
-#endif  // TINT_BUILD_WGSL_WRITER
-            }
-
+            // TODO(dawn:2033): Avoid unnecessary copies of the SPIR-V code.
             std::vector<uint32_t> spirv(spirvDesc->code, spirvDesc->code + spirvDesc->codeSize);
+
 #ifdef DAWN_ENABLE_SPIRV_VALIDATION
             const bool dumpSpirv = device->IsToggleEnabled(Toggle::DumpShaders);
             DAWN_TRY(ValidateSpirv(device, spirv.data(), spirv.size(), dumpSpirv));
diff --git a/src/dawn/native/Toggles.cpp b/src/dawn/native/Toggles.cpp
index 8fb0d31..6cd1fae 100644
--- a/src/dawn/native/Toggles.cpp
+++ b/src/dawn/native/Toggles.cpp
@@ -198,12 +198,6 @@
       "Dump shaders for debugging purposes. Dumped shaders will be log via EmitLog, thus printed "
       "in Chrome console or consumed by user-defined callback function.",
       "https://crbug.com/dawn/792", ToggleStage::Device}},
-    {Toggle::ForceWGSLStep,
-     {"force_wgsl_step",
-      "When ingesting SPIR-V shaders, force a first conversion to WGSL. This allows testing Tint's "
-      "SPIRV->WGSL translation on real content to be sure that it will work when the same "
-      "translation runs in a WASM module in the page.",
-      "https://crbug.com/dawn/960", ToggleStage::Device}},
     {Toggle::DisableWorkgroupInit,
      {"disable_workgroup_init",
       "Disables the workgroup memory zero-initialization for compute shaders.",
diff --git a/src/dawn/native/Toggles.h b/src/dawn/native/Toggles.h
index 491ff36..3c96284 100644
--- a/src/dawn/native/Toggles.h
+++ b/src/dawn/native/Toggles.h
@@ -60,7 +60,6 @@
     EmitHLSLDebugSymbols,
     DisallowSpirv,
     DumpShaders,
-    ForceWGSLStep,
     DisableWorkgroupInit,
     DisableSymbolRenaming,
     UseUserDefinedLabelsInBackend,