瀏覽代碼

Merged PR 85: Don't validate external user defined functions as if they are Dxil Ops

Don't validate external user defined functions as if they are Dxil Ops
Tex Riddell 7 年之前
父節點
當前提交
a078a0ab44
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      lib/HLSL/DxilValidation.cpp

+ 5 - 0
lib/HLSL/DxilValidation.cpp

@@ -2113,6 +2113,7 @@ static void ValidateExternalFunction(Function *F, ValidationContext &ValCtx) {
 
   const ShaderModel *pSM = ValCtx.DxilMod.GetShaderModel();
   OP *hlslOP = ValCtx.DxilMod.GetOP();
+  bool isDxilOp = OP::IsDxilOpFunc(F);
   Type *voidTy = Type::getVoidTy(F->getContext());
   for (User *user : F->users()) {
     CallInst *CI = dyn_cast<CallInst>(user);
@@ -2121,6 +2122,10 @@ static void ValidateExternalFunction(Function *F, ValidationContext &ValCtx) {
       continue;
     }
 
+    // Skip call to external user defined function
+    if (!isDxilOp)
+      continue;
+
     Value *argOpcode = CI->getArgOperand(0);
     ConstantInt *constOpcode = dyn_cast<ConstantInt>(argOpcode);
     if (!constOpcode) {