10JPH_SUPPRESS_WARNING_PUSH
 
   14#ifdef JPH_TRACK_NARROWPHASE_STATS 
   15    #define JPH_IF_TRACK_NARROWPHASE_STATS(...) __VA_ARGS__ 
   17    #define JPH_IF_TRACK_NARROWPHASE_STATS(...) 
   20JPH_SUPPRESS_WARNING_POP
 
   22#ifdef JPH_TRACK_NARROWPHASE_STATS 
   35    static void             sReportStats();
 
   37    atomic<uint64>          mNumQueries = 0;
 
   38    atomic<uint64>          mHitsReported = 0;
 
   39    atomic<uint64>          mTotalTicks = 0;
 
   40    atomic<uint64>          mChildTicks = 0;
 
   42    static NarrowPhaseStat  sCollideShape[NumSubShapeTypes][NumSubShapeTypes];
 
   43    static NarrowPhaseStat  sCastShape[NumSubShapeTypes][NumSubShapeTypes];
 
   47class TrackNarrowPhaseStat
 
   50                            TrackNarrowPhaseStat(NarrowPhaseStat &inStat) :
 
   59                            ~TrackNarrowPhaseStat()
 
   64        if (mParent != 
nullptr)
 
   65            mParent->mStat.mChildTicks += delta_ticks;
 
   69        mStat.mTotalTicks += delta_ticks;
 
   76    NarrowPhaseStat &       mStat;
 
   77    TrackNarrowPhaseStat *  mParent;
 
   80    static thread_local TrackNarrowPhaseStat *sRoot;
 
   84class TrackNarrowPhaseCollector
 
   87                            TrackNarrowPhaseCollector() :
 
   92                            ~TrackNarrowPhaseCollector()
 
   96        if (TrackNarrowPhaseStat::sRoot != 
nullptr)
 
   97            TrackNarrowPhaseStat::sRoot->mStat.mChildTicks += delta_ticks;
 
  100        for (TrackNarrowPhaseStat *track = TrackNarrowPhaseStat::sRoot; track != 
nullptr; track = track->mParent)
 
  101            track->mStat.mHitsReported++;
 
std::uint64_t uint64
Definition: Core.h:456
 
#define JPH_NAMESPACE_END
Definition: Core.h:378
 
#define JPH_CLANG_SUPPRESS_WARNING(w)
Definition: Core.h:263
 
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372
 
#define JPH_ASSERT(...)
Definition: IssueReporting.h:33
 
EShapeSubType
This enumerates all shape types, each shape can return its type through Shape::GetSubType.
Definition: Shape.h:77
 
JPH_NAMESPACE_BEGIN JPH_INLINE uint64 GetProcessorTickCount()
Functionality to get the processors cycle counter.
Definition: TickCounter.h:26