29 #ifndef NVBLASTDEFAULTPROFILER_H 30 #define NVBLASTDEFAULTPROFILER_H 33 #include "PxProfiler.h" 34 #include <PxFoundation.h> 37 #include "nvToolsExt.h" 42 #include "xboxone/NvBlastProfilerXB1.h" 45 #include "ps4/NvBlastProfilerPS4.h" 53 #define SUPPORTS_THREAD_LOCAL (!NV_VC || NV_VC > 12) 66 #if SUPPORTS_THREAD_LOCAL 67 static const int32_t PROFILER_MAX_NESTED_DEPTH = 64;
68 static thread_local
ExtProfileData th_ProfileData[PROFILER_MAX_NESTED_DEPTH];
69 static thread_local int32_t th_depth = 0;
91 #if SUPPORTS_THREAD_LOCAL 92 if (PxGetProfilerCallback())
94 void*
data = PxGetProfilerCallback()->zoneStart(name,
false, 0xb1a57);
96 if (th_depth < PROFILER_MAX_NESTED_DEPTH && th_depth >= 0)
98 th_ProfileData[th_depth].name =
name;
99 th_ProfileData[th_depth].data =
data;
104 assert(th_depth < PROFILER_MAX_NESTED_DEPTH && th_depth >= 0);
109 if (m_platformEnabled)
118 #if SUPPORTS_THREAD_LOCAL 119 if (PxGetProfilerCallback())
126 PxGetProfilerCallback()->zoneEnd(pd.
data, pd.
name,
false, 0xb1a57);
130 assert(th_depth >= 0);
135 if (m_platformEnabled)
151 m_platformEnabled = enabled;
155 bool m_platformEnabled;
162 #endif // NVBLASTDEFAULTPROFILER_H virtual void zoneStart(const char *name) override
Definition: NvBlastExtCustomProfiler.h:88
NV_INLINE void platformZoneEnd()
Definition: NvBlastExtCustomProfiler.h:49
Definition: NvBlastExtCustomProfiler.h:77
NV_INLINE void platformZoneStart(const char *)
Definition: NvBlastExtCustomProfiler.h:48
void setPlatformEnabled(bool enabled)
Definition: NvBlastExtCustomProfiler.h:149
ExtCustomProfiler()
Definition: NvBlastExtCustomProfiler.h:83
virtual void zoneEnd() override
Definition: NvBlastExtCustomProfiler.h:115
Definition: NvBlastProfiler.h:44
void * data
Definition: NvBlastExtCustomProfiler.h:63
Definition: NvBlastExtCustomProfiler.h:60
Definition: NvBlastExtAuthoring.h:34
const char * name
Definition: NvBlastExtCustomProfiler.h:62