Browse Source

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 years ago
parent
commit
a078a0ab44
1 changed files with 5 additions and 0 deletions
  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) {