Skip to content

Commit 6fdaf77

Browse files
committed
fix hlmodule initialization bug
1 parent 28d9a92 commit 6fdaf77

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/DXIL/DxilMetadataHelper.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,10 @@ void DxilMDHelper::GetDxilResources(const MDOperand &MDO, const MDTuple *&pSRVs,
668668
const MDTuple *&pUAVs,
669669
const MDTuple *&pCBuffers,
670670
const MDTuple *&pSamplers) {
671-
IFTBOOL(MDO.get() != nullptr, DXC_E_INCORRECT_DXIL_METADATA);
671+
if (!MDO.get()) {
672+
pSRVs = pUAVs = pCBuffers = pSamplers = nullptr;
673+
return;
674+
}
672675
const MDTuple *pTupleMD = dyn_cast<MDTuple>(MDO.get());
673676
IFTBOOL(pTupleMD != nullptr, DXC_E_INCORRECT_DXIL_METADATA);
674677
IFTBOOL(pTupleMD->getNumOperands() == kDxilNumResourceFields,

0 commit comments

Comments
 (0)