@@ -880,17 +880,14 @@ int DxcContext::Compile() {
880880 args.data (), args.size (), m_Opts.Defines .data (),
881881 m_Opts.Defines .size (), pIncludeHandler, &pCompileResult));
882882 } else {
883- DxcBuffer buf = {};
884- buf.Ptr = pSource->GetBufferPointer ();
885- buf.Size = pSource->GetBufferSize ();
886- buf.Encoding = CP_UTF8;
887-
888- CComPtr<IDxcCompiler3> pCompilerv3;
889- IFT (CreateInstance (CLSID_DxcCompiler, &pCompilerv3));
890-
891- IFT (pCompilerv3->Compile (&buf, args.data (), args.size (),
892- pIncludeHandler,
893- IID_PPV_ARGS (&pCompileResult)));
883+ // This compilation invocation will sub in "-Vd" to disable internal
884+ // validation so that validation is handled directly immediately
885+ // afterwards.
886+ IFT (pCompiler->Compile (
887+ pSource, StringRefWide (m_Opts.InputFile ),
888+ StringRefWide (m_Opts.EntryPoint ), StringRefWide (TargetProfile),
889+ args.data (), args.size (), m_Opts.Defines .data (),
890+ m_Opts.Defines .size (), pIncludeHandler, &pCompileResult));
894891
895892 // dont validate when validation was disabled, or
896893 // there are compilation errors
0 commit comments