@@ -888,7 +888,7 @@ Value* RTBuilder::getPrimitiveIndex(
888
888
Value* ShaderTy,
889
889
bool checkInstanceLeafPtr)
890
890
{
891
- if (checkInstanceLeafPtr)
891
+ if (checkInstanceLeafPtr && IGC_IS_FLAG_ENABLED (ForceRTCheckInstanceLeafPtr) )
892
892
{
893
893
auto [ValidBB, PN] =
894
894
validateInstanceLeafPtr (perLaneStackPtr, I, CreateICmpEQ (ShaderTy, getInt32 (CallableShaderTypeMD::ClosestHit)));
@@ -904,30 +904,6 @@ Value* RTBuilder::getPrimitiveIndex(
904
904
}
905
905
}
906
906
907
- static Value* skipIfShaderIsNotHit (RTBuilder& IRB, Value* ShaderTy, std::function<Value* ()> Fn)
908
- {
909
- auto * isHit = IRB.CreateOr ({
910
- IRB.CreateICmpEQ (ShaderTy, IRB.getInt32 (CallableShaderTypeMD::ClosestHit)),
911
- IRB.CreateICmpEQ (ShaderTy, IRB.getInt32 (CallableShaderTypeMD::AnyHit)),
912
- IRB.CreateICmpEQ (ShaderTy, IRB.getInt32 (CallableShaderTypeMD::Intersection)),
913
- });
914
-
915
- auto [isHitBB, joinBB] = IRB.createTriangleFlow (isHit, &*IRB.GetInsertPoint (), VALUE_NAME (" skipIfShaderIsNotHit_isHitBB" ), VALUE_NAME (" skipIfShaderIsNotHit_joinBB" ));
916
-
917
- IRB.SetInsertPoint (isHitBB);
918
- auto * retV = Fn ();
919
-
920
- IRB.SetInsertPoint (isHitBB->getSinglePredecessor ());
921
- auto * defaultV = IRB.CreateZExtOrBitCast (IRB.getInt1 (0 ), retV->getType ());
922
-
923
- IRB.SetInsertPoint (joinBB);
924
- auto * phiV = IRB.CreatePHI (retV->getType (), 2 );
925
- phiV->addIncoming (retV, isHitBB);
926
- phiV->addIncoming (defaultV, isHitBB->getSinglePredecessor ());
927
-
928
- return phiV;
929
- }
930
-
931
907
Value* RTBuilder::getPrimitiveIndex (
932
908
RTBuilder::StackPointerVal* perLaneStackPtr, Value* leafType, Value* ShaderTy)
933
909
{
@@ -955,7 +931,7 @@ Value* RTBuilder::getGeometryIndex(
955
931
Value* ShaderTy,
956
932
bool checkInstanceLeafPtr)
957
933
{
958
- if (checkInstanceLeafPtr)
934
+ if (checkInstanceLeafPtr && IGC_IS_FLAG_ENABLED (ForceRTCheckInstanceLeafPtr) )
959
935
{
960
936
auto [ValidBB, PN] =
961
937
validateInstanceLeafPtr (perLaneStackPtr, I, CreateICmpEQ (ShaderTy, getInt32 (CallableShaderTypeMD::ClosestHit)));
0 commit comments