浏览代码

For case a system semantic don't have index, add 0 for it when load metadata. (#1499)

Xiang Li 7 年之前
父节点
当前提交
12fa3184d4
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      lib/HLSL/DxilMetadataHelper.cpp

+ 4 - 0
lib/HLSL/DxilMetadataHelper.cpp

@@ -439,6 +439,10 @@ void DxilMDHelper::LoadSignatureElement(const MDOperand &MDO, DxilSignatureEleme
   SE.Initialize(pName->getString(), CT, IM, NumRows, NumCols, StartRow, StartCol, ID, SemanticIndexVector);
   SE.SetKind(SemKind);
 
+  // For case a system semantic don't have index, add 0 for it.
+  if (SemanticIndexVector.empty() && !SE.IsArbitrary()) {
+    SE.SetSemanticIndexVec({0});
+  }
   // Name-value list of extended properties.
   m_ExtraPropertyHelper->LoadSignatureElementProperties(pTupleMD->getOperand(kDxilSignatureElementNameValueList), SE);
 }