Skip to content

Commit 44c2c67

Browse files
committed
address Tex
1 parent 9756878 commit 44c2c67

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

tools/clang/tools/dxcompiler/dxcutil.cpp

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -151,35 +151,13 @@ HRESULT ValidateAndAssembleToContainer(AssembleInputs &inputs) {
151151
CComPtr<IDxcValidator> pValidator;
152152
CreateValidator(pValidator);
153153

154-
if (llvm::getDebugMetadataVersionFromModule(*inputs.pM) != 0) {
154+
if (llvm::getDebugMetadataVersionFromModule(*inputs.pM) != 0)
155155
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-
}
177156

178157
AssembleToContainer(inputs);
179158

180159
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
183161
inputs.ValidationFlags |= DxcValidatorFlags_InPlaceEdit;
184162
IFT(RunInternalValidator(pValidator, llvmModuleWithDebugInfo.get(),
185163
inputs.pOutputContainerBlob, inputs.ValidationFlags,

0 commit comments

Comments
 (0)