Skip to content

Commit

Permalink
for now, do not permit non-library-profile blobs with a CompilerVersi…
Browse files Browse the repository at this point in the history
…on part.
  • Loading branch information
bob80905 committed Jul 3, 2023
1 parent 68d38a7 commit 27a63e2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/HLSL/DxilValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5731,13 +5731,16 @@ HRESULT ValidateDxilContainerParts(llvm::Module *pModule,
VerifyFeatureInfoMatches(ValCtx, GetDxilPartData(pPart), pPart->PartSize);
break;
case DFCC_CompilerVersion:
// Either this blob is a PDB, or it is a library with shader model at least 6.8
// This blob is either a PDB, or a library profile
if (ValCtx.isLibProfile) {
if (!ValidateCompilerVersionPart((void *)GetDxilPartData(pPart), pPart->PartSize))
{
ValCtx.EmitFormatError(ValidationRule::ContainerPartInvalid, { szFourCC });
ValCtx.EmitFormatError(ValidationRule::ContainerPartInvalid, { szFourCC });
}
}
else {
ValCtx.EmitFormatError(ValidationRule::ContainerPartInvalid, { szFourCC });
}
break;

case DFCC_RootSignature:
Expand Down

0 comments on commit 27a63e2

Please sign in to comment.