Skip to content

Commit

Permalink
Updated RenderPlatform::Print() profiling name. Fixed DefaultProfiler…
Browse files Browse the repository at this point in the history
… not setting updatedThisFrame for root.
  • Loading branch information
AndrewRichards-Code committed Sep 20, 2024
1 parent 68c82de commit f80ee46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions Core/ProfilingInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <algorithm>

#ifndef _MSC_VER
#ifndef UNIX
#ifndef UNIX
#ifdef NN_NINTENDO_SDK
#include <nn/util/util_FloatFormat.h>
#define _isnanf (nn::util::FloatFormat16::IsNan)
Expand Down Expand Up @@ -144,7 +144,7 @@ platform::core::DefaultProfiler::DefaultProfiler():overhead(0.0f)

DefaultProfiler::~DefaultProfiler()
{
Clear();
Clear();
}

void platform::core::BaseProfilingInterface::WalkReset(ProfileData *p)
Expand Down Expand Up @@ -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;
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions CrossPlatform/RenderPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit f80ee46

Please sign in to comment.