소스 검색

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;