some renaming
This commit is contained in:
parent
f195e77be7
commit
2e4b7004c9
@ -137,12 +137,12 @@ static void Run()
|
|||||||
|
|
||||||
g_profiler->EndScope();
|
g_profiler->EndScope();
|
||||||
|
|
||||||
g_recorderProfiler->BuildRecords();
|
g_profilerRecorder->BuildRecords();
|
||||||
|
|
||||||
if (g_settings->drawProfile)
|
if (g_settings->drawProfile)
|
||||||
{
|
{
|
||||||
records.Resize(0);
|
records.Resize(0);
|
||||||
g_recorderProfiler->BuildSortedRecords(records);
|
g_profilerRecorder->BuildSortedRecords(records);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_profiler->End();
|
g_profiler->End();
|
||||||
|
@ -26,7 +26,7 @@ Model::Model()
|
|||||||
g_draw = &m_draw;
|
g_draw = &m_draw;
|
||||||
g_camera = &m_camera;
|
g_camera = &m_camera;
|
||||||
g_profiler = &m_profiler;
|
g_profiler = &m_profiler;
|
||||||
g_recorderProfiler = &m_recorderProfiler;
|
g_profilerRecorder = &m_profilerRecorder;
|
||||||
|
|
||||||
#if (PROFILE_JSON == 1)
|
#if (PROFILE_JSON == 1)
|
||||||
g_profilerListener = &m_jsonListener;
|
g_profilerListener = &m_jsonListener;
|
||||||
@ -56,7 +56,7 @@ Model::~Model()
|
|||||||
g_draw = nullptr;
|
g_draw = nullptr;
|
||||||
g_camera = nullptr;
|
g_camera = nullptr;
|
||||||
g_profiler = nullptr;
|
g_profiler = nullptr;
|
||||||
g_recorderProfiler = nullptr;
|
g_profilerRecorder = nullptr;
|
||||||
|
|
||||||
#if (PROFILE_JSON == 1)
|
#if (PROFILE_JSON == 1)
|
||||||
g_profilerListener = nullptr;
|
g_profilerListener = nullptr;
|
||||||
|
@ -21,10 +21,10 @@
|
|||||||
|
|
||||||
#include <testbed/framework/draw.h>
|
#include <testbed/framework/draw.h>
|
||||||
#include <testbed/framework/profiler.h>
|
#include <testbed/framework/profiler.h>
|
||||||
#include <testbed/framework/recorder_profiler.h>
|
#include <testbed/framework/profiler_recorder.h>
|
||||||
|
|
||||||
// Set to 1 to write profile events into a .json file. Set to 0 otherwise.
|
// Set to 1 to write profile events into a .json file. Set to 0 otherwise.
|
||||||
#define PROFILE_JSON 1
|
#define PROFILE_JSON 0
|
||||||
|
|
||||||
#if (PROFILE_JSON == 1)
|
#if (PROFILE_JSON == 1)
|
||||||
#include <testbed\framework\json_profiler.h>
|
#include <testbed\framework\json_profiler.h>
|
||||||
@ -71,7 +71,7 @@ private:
|
|||||||
Draw m_draw;
|
Draw m_draw;
|
||||||
Camera m_camera;
|
Camera m_camera;
|
||||||
Profiler m_profiler;
|
Profiler m_profiler;
|
||||||
RecorderProfiler m_recorderProfiler;
|
ProfilerRecorder m_profilerRecorder;
|
||||||
|
|
||||||
#if (PROFILE_JSON == 1)
|
#if (PROFILE_JSON == 1)
|
||||||
JsonProfiler m_jsonListener;
|
JsonProfiler m_jsonListener;
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
// End the top scope.
|
// End the top scope.
|
||||||
void EndScope();
|
void EndScope();
|
||||||
private:
|
private:
|
||||||
friend class RecorderProfiler;
|
friend class ProfilerRecorder;
|
||||||
|
|
||||||
ProfilerNode* CreateNode();
|
ProfilerNode* CreateNode();
|
||||||
void DestroyNode(ProfilerNode* node);
|
void DestroyNode(ProfilerNode* node);
|
||||||
|
@ -16,12 +16,12 @@
|
|||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <testbed/framework/recorder_profiler.h>
|
#include <testbed/framework/profiler_recorder.h>
|
||||||
#include <testbed/framework/profiler.h>
|
#include <testbed/framework/profiler.h>
|
||||||
|
|
||||||
RecorderProfiler* g_recorderProfiler = nullptr;
|
ProfilerRecorder* g_profilerRecorder = nullptr;
|
||||||
|
|
||||||
ProfilerRecord* RecorderProfiler::FindRecord(const char* name)
|
ProfilerRecord* ProfilerRecorder::FindRecord(const char* name)
|
||||||
{
|
{
|
||||||
for (u32 i = 0; i < m_records.Count(); ++i)
|
for (u32 i = 0; i < m_records.Count(); ++i)
|
||||||
{
|
{
|
||||||
@ -34,7 +34,7 @@ ProfilerRecord* RecorderProfiler::FindRecord(const char* name)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecorderProfiler::RecurseBuildRecords(ProfilerNode* node)
|
void ProfilerRecorder::RecurseBuildRecords(ProfilerNode* node)
|
||||||
{
|
{
|
||||||
ProfilerRecord* fr = FindRecord(node->name);
|
ProfilerRecord* fr = FindRecord(node->name);
|
||||||
if (fr)
|
if (fr)
|
||||||
@ -66,7 +66,7 @@ void RecorderProfiler::RecurseBuildRecords(ProfilerNode* node)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecorderProfiler::BuildRecords()
|
void ProfilerRecorder::BuildRecords()
|
||||||
{
|
{
|
||||||
for (u32 i = 0; i < m_records.Count(); ++i)
|
for (u32 i = 0; i < m_records.Count(); ++i)
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ static ProfilerRecord* FindSortedRecord(b3Array<ProfilerRecord*>& records, const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecorderProfiler::RecurseBuildSortedRecords(ProfilerNode* node, b3Array<ProfilerRecord*>& output)
|
void ProfilerRecorder::RecurseBuildSortedRecords(ProfilerNode* node, b3Array<ProfilerRecord*>& output)
|
||||||
{
|
{
|
||||||
ProfilerRecord* fsr = FindSortedRecord(output, node->name);
|
ProfilerRecord* fsr = FindSortedRecord(output, node->name);
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ void RecorderProfiler::RecurseBuildSortedRecords(ProfilerNode* node, b3Array<Pro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecorderProfiler::BuildSortedRecords(b3Array<ProfilerRecord*>& output)
|
void ProfilerRecorder::BuildSortedRecords(b3Array<ProfilerRecord*>& output)
|
||||||
{
|
{
|
||||||
assert(output.Count() == 0);
|
assert(output.Count() == 0);
|
||||||
|
|
@ -16,8 +16,8 @@
|
|||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RECORDER_PROFILER_H
|
#ifndef PROFILER_RECORDER_H
|
||||||
#define RECORDER_PROFILER_H
|
#define PROFILER_RECORDER_H
|
||||||
|
|
||||||
#include <bounce/common/math/math.h>
|
#include <bounce/common/math/math.h>
|
||||||
#include <bounce/common/template/array.h>
|
#include <bounce/common/template/array.h>
|
||||||
@ -35,7 +35,7 @@ struct ProfilerRecord
|
|||||||
};
|
};
|
||||||
|
|
||||||
// This class maintains persistent profiler records
|
// This class maintains persistent profiler records
|
||||||
class RecorderProfiler
|
class ProfilerRecorder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void BuildRecords();
|
void BuildRecords();
|
||||||
@ -53,6 +53,6 @@ private:
|
|||||||
b3StackArray<ProfilerRecord, 256> m_records; // persistent profiler records
|
b3StackArray<ProfilerRecord, 256> m_records; // persistent profiler records
|
||||||
};
|
};
|
||||||
|
|
||||||
extern RecorderProfiler* g_recorderProfiler;
|
extern ProfilerRecorder* g_profilerRecorder;
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user