@@ -151,35 +151,13 @@ HRESULT ValidateAndAssembleToContainer(AssembleInputs &inputs) {
151
151
CComPtr<IDxcValidator> pValidator;
152
152
CreateValidator (pValidator);
153
153
154
- if (llvm::getDebugMetadataVersionFromModule (*inputs.pM ) != 0 ) {
154
+ if (llvm::getDebugMetadataVersionFromModule (*inputs.pM ) != 0 )
155
155
llvmModuleWithDebugInfo.reset (llvm::CloneModule (inputs.pM .get ()));
156
- }
157
-
158
- // Verify validator version can validate this module
159
- CComPtr<IDxcVersionInfo> pValidatorVersion;
160
- IFT (pValidator->QueryInterface (&pValidatorVersion));
161
- UINT32 ValMajor, ValMinor;
162
- IFT (pValidatorVersion->GetVersion (&ValMajor, &ValMinor));
163
- DxilModule &DM = inputs.pM .get ()->GetOrCreateDxilModule ();
164
- unsigned ReqValMajor, ReqValMinor;
165
- DM.GetValidatorVersion (ReqValMajor, ReqValMinor);
166
- if (DXIL::CompareVersions (ValMajor, ValMinor, ReqValMajor, ReqValMinor) < 0 ) {
167
- // Module is expecting to be validated by a newer validator.
168
- if (inputs.pDiag ) {
169
- unsigned diagID = inputs.pDiag ->getCustomDiagID (
170
- clang::DiagnosticsEngine::Level::Error,
171
- " The module cannot be validated by the version of the validator "
172
- " currently attached." );
173
- inputs.pDiag ->Report (diagID);
174
- }
175
- return E_FAIL;
176
- }
177
156
178
157
AssembleToContainer (inputs);
179
158
180
159
CComPtr<IDxcOperationResult> pValResult;
181
- // Important: in-place edit is required so the blob is reused and thus
182
- // dxil.dll can be released.
160
+ // In-place edit to avoid an extra copy
183
161
inputs.ValidationFlags |= DxcValidatorFlags_InPlaceEdit;
184
162
IFT (RunInternalValidator (pValidator, llvmModuleWithDebugInfo.get (),
185
163
inputs.pOutputContainerBlob , inputs.ValidationFlags ,
0 commit comments