Skip to content

Commit

Permalink
remove 6.8 gating, remove unused var
Browse files Browse the repository at this point in the history
  • Loading branch information
bob80905 committed Jun 30, 2023
1 parent 20c274a commit 8d72f47
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
24 changes: 11 additions & 13 deletions lib/DxilContainer/DxilContainerAssembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1749,27 +1749,25 @@ void hlsl::SerializeDxilContainerForModule(
DXASSERT_NOMSG(pModule->GetSerializedRootSignature().empty());

bool bMetadataStripped = false;
const hlsl::ShaderModel *pSM = pModule->GetShaderModel();
if (pModule->GetShaderModel()->IsLib()) {
DXASSERT(pModule->GetSerializedRootSignature().empty(),
"otherwise, library has root signature outside subobject definitions");
// Write the DxilCompilerVersion (VERS) part.

if (pSM->IsSM68Plus()) {
if (DXCVersionInfo) {
if (DXCVersionInfo) {

pVERSWriter = llvm::make_unique<DxilVersionWriter>(DXCVersionInfo);
pVERSWriter = llvm::make_unique<DxilVersionWriter>(DXCVersionInfo);

writer.AddPart(
hlsl::DFCC_CompilerVersion,
pVERSWriter->size(),
[&pVERSWriter](AbstractMemoryStream *pStream) {
pVERSWriter->write(pStream);
return S_OK;
}
);
}
writer.AddPart(
hlsl::DFCC_CompilerVersion,
pVERSWriter->size(),
[&pVERSWriter](AbstractMemoryStream *pStream) {
pVERSWriter->write(pStream);
return S_OK;
}
);
}


// Write the DxilRuntimeData (RDAT) part.
pRDATWriter = llvm::make_unique<DxilRDATWriter>(*pModule);
Expand Down
2 changes: 1 addition & 1 deletion lib/HLSL/DxilValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5732,7 +5732,7 @@ HRESULT ValidateDxilContainerParts(llvm::Module *pModule,
break;
case DFCC_CompilerVersion:
// Either this blob is a PDB, or it is a library with shader model at least 6.8
if (pDxilModule->GetShaderModel()->IsSM68Plus() && ValCtx.isLibProfile) {
if (ValCtx.isLibProfile) {
if (!ValidateCompilerVersionPart((void *)GetDxilPartData(pPart), pPart->PartSize))
{
ValCtx.EmitFormatError(ValidationRule::ContainerPartInvalid, { szFourCC });
Expand Down
3 changes: 1 addition & 2 deletions tools/clang/tools/dxcompiler/dxcompilerobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,7 @@ class DxcCompiler : public IDxcCompiler3,
std::move(serializeModule), pOutputBlob, m_pMalloc,
SerializeFlags, pOutputStream, opts.GetPDBName(),
&compiler.getDiagnostics(), &ShaderHashContent, pReflectionStream,
pRootSigStream, pRootSignatureBlob, pPrivateBlob,
opts.SelectValidator);
pRootSigStream, pRootSignatureBlob, pPrivateBlob);

inputs.pVersionInfo = static_cast<IDxcVersionInfo *>(this);

Expand Down
3 changes: 1 addition & 2 deletions tools/clang/unittests/HLSL/DxilContainerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2111,7 +2111,7 @@ TEST_F(DxilContainerTest, DxilContainerCompilerVersionTest) {
hlsl::IsValidDxilContainer(pHeader, pProgram->GetBufferSize()));
VERIFY_IS_NOT_NULL(
hlsl::IsDxilContainerLike(pHeader, pProgram->GetBufferSize()));
VERIFY_IS_NULL(
VERIFY_IS_NOT_NULL(
hlsl::GetDxilPartByType(pHeader, hlsl::DxilFourCC::DFCC_CompilerVersion));

pResult.Release();
Expand Down Expand Up @@ -2159,7 +2159,6 @@ TEST_F(DxilContainerTest, DxilContainerCompilerVersionTest) {
pVersionInfo3->GetCustomVersionString(&pCustomVersionStrRef));

// test the "true" information against what's in the blob

VERIFY_IS_TRUE(pVersionHeader->PartFourCC ==
hlsl::DxilFourCC::DFCC_CompilerVersion);
// test the rest of the contents (major, minor, etc.)
Expand Down

0 comments on commit 8d72f47

Please sign in to comment.