From f80ee466d7b8f975d32d01550375761ef171e1fa Mon Sep 17 00:00:00 2001 From: Andrew Richards Date: Fri, 20 Sep 2024 10:02:44 +0100 Subject: [PATCH] Updated RenderPlatform::Print() profiling name. Fixed DefaultProfiler not setting updatedThisFrame for root. --- Core/ProfilingInterface.cpp | 10 ++++++---- CrossPlatform/RenderPlatform.cpp | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Core/ProfilingInterface.cpp b/Core/ProfilingInterface.cpp index 53089c2f1..6df39fd78 100644 --- a/Core/ProfilingInterface.cpp +++ b/Core/ProfilingInterface.cpp @@ -12,7 +12,7 @@ #include #ifndef _MSC_VER - #ifndef UNIX + #ifndef UNIX #ifdef NN_NINTENDO_SDK #include #define _isnanf (nn::util::FloatFormat16::IsNan) @@ -144,7 +144,7 @@ platform::core::DefaultProfiler::DefaultProfiler():overhead(0.0f) DefaultProfiler::~DefaultProfiler() { - Clear(); + Clear(); } void platform::core::BaseProfilingInterface::WalkReset(ProfileData *p) @@ -190,14 +190,14 @@ void platform::core::DefaultProfiler::Begin(const char *name) { SIMUL_CERR << "Profiler level out of whack! Do you have a mismatched begin/end pair?" << std::endl; } - Timing *parentData=NULL; + Timing *parentData=NULL; if(profileStack.size()) parentData=(Timing*)profileStack.back(); else { parentData=(Timing*)root; } - Timing *profileData = NULL; + Timing *profileData = NULL; if(parentData->children.find(name)==parentData->children.end()) { parentData->children[name]=profileData=new Timing; @@ -215,6 +215,8 @@ void platform::core::DefaultProfiler::Begin(const char *name) profileData->name=name; profileData->last_child_updated=0; profileData->parent=parentData; + + parentData->updatedThisFrame=true; } void platform::core::DefaultProfiler::End() diff --git a/CrossPlatform/RenderPlatform.cpp b/CrossPlatform/RenderPlatform.cpp index 75c675741..1711cc03b 100644 --- a/CrossPlatform/RenderPlatform.cpp +++ b/CrossPlatform/RenderPlatform.cpp @@ -1859,7 +1859,7 @@ void RenderPlatform::Draw2dLine(GraphicsDeviceContext &deviceContext,vec2 pos1,v int RenderPlatform::Print(GraphicsDeviceContext& deviceContext, int x, int y, const char* text, const float* colr, const float* bkg) { - SIMUL_COMBINED_PROFILE_START(deviceContext, "text") + SIMUL_COMBINED_PROFILE_START(deviceContext, "Print") static float clr[]={1.f,1.f,0.f,1.f}; static float black[]={0.f,0.f,0.f,0.0f}; if(!colr) @@ -1878,7 +1878,7 @@ int RenderPlatform::Print(GraphicsDeviceContext& deviceContext, int x, int y, co int RenderPlatform::Print(MultiviewGraphicsDeviceContext& deviceContext, float* xs, float* ys, const char* text, const float* colr, const float* bkg) { - SIMUL_COMBINED_PROFILE_START(deviceContext, "text") + SIMUL_COMBINED_PROFILE_START(deviceContext, "Print") static float clr[] = { 1.f,1.f,0.f,1.f }; static float black[] = { 0.f,0.f,0.f,0.0f }; if (!colr)