浏览代码

Don't instrument that! (#3176)

Co-authored-by: Jeff Noyle <[email protected]>
Jeff Noyle 5 年之前
父节点
当前提交
b0c029eebd
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      lib/DxilPIXPasses/DxilDebugInstrumentation.cpp

+ 12 - 0
lib/DxilPIXPasses/DxilDebugInstrumentation.cpp

@@ -833,6 +833,18 @@ void DxilDebugInstrumentation::addStepDebugEntry(BuilderContext &BC,
     return;
   }
 
+  if (Inst->getOpcode() == Instruction::OtherOps::Call) {
+    if (Inst->getNumOperands() > 0) {
+      if (auto *asInt =
+              llvm::cast_or_null<llvm::ConstantInt>(Inst->getOperand(0))) {
+        if (asInt->getZExtValue() == (uint64_t)DXIL::OpCode::AllocateRayQuery) {
+          // Ray query handles should not be stored in the debug trace UAV
+          return;
+        }
+      }
+    }
+  }
+
   if (auto *St = llvm::dyn_cast<llvm::StoreInst>(Inst)) {
     addStoreStepDebugEntry(BC, St);
     return;