[dawn] Move d3d (hlsl) over to IR single entry point

Bug: 383725598
Change-Id: If3de6ef3e794e6ce21be0e9c78baeeaa0d745897
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/231455
Commit-Queue: Peter McNeeley <petermcneeley@google.com>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/dawn/native/d3d/ShaderUtils.cpp b/src/dawn/native/d3d/ShaderUtils.cpp
index 794c024..09598a7 100644
--- a/src/dawn/native/d3d/ShaderUtils.cpp
+++ b/src/dawn/native/d3d/ShaderUtils.cpp
@@ -245,7 +245,7 @@
 
     tint::Program transformedProgram;
     tint::ast::transform::DataMap transformOutputs;
-    {
+    if (!r.useTintIR) {
         TRACE_EVENT0(tracePlatform.UnsafeGetValue(), General, "RunTransforms");
         DAWN_TRY_ASSIGN(transformedProgram,
                         RunTransforms(&transformManager, r.inputProgram, transformInputs,
@@ -267,10 +267,16 @@
     tint::Result<tint::hlsl::writer::Output> result;
     if (r.useTintIR) {
         // Convert the AST program to an IR module.
-        auto ir = tint::wgsl::reader::ProgramToLoweredIR(transformedProgram);
+        auto ir = tint::wgsl::reader::ProgramToLoweredIR(*r.inputProgram);
         DAWN_INVALID_IF(ir != tint::Success, "An error occurred while generating Tint IR\n%s",
                         ir.Failure().reason.Str());
 
+        auto singleEntryPointResult =
+            tint::core::ir::transform::SingleEntryPoint(ir.Get(), r.entryPointName);
+        DAWN_INVALID_IF(singleEntryPointResult != tint::Success,
+                        "Pipeline single entry point (IR) failed:\n%s",
+                        singleEntryPointResult.Failure().reason);
+
         if (r.substituteOverrideConfig) {
             // this needs to run after SingleEntryPoint transform which removes unused
             // overrides for the current entry point.