Profiler - "Expected order" workaround
So the profiler apparently expects starts and ends to be consistent in ordering. Whenever the order changes, it will likely crash. Modified the main loop so it doesn't add the debug output's timings if the profiler has been reset due to reloading as a workaround. This needs to be fixed, though.
This commit is contained in:
parent
68d01ca42e
commit
a266120761
4 changed files with 18 additions and 5 deletions
15
m-tool.cc
15
m-tool.cc
|
@ -175,14 +175,23 @@ void T_Main::makeUI( )
|
|||
void T_Main::render( )
|
||||
{
|
||||
if ( demo ) {
|
||||
demo->render( );
|
||||
const bool hadReset = demo->render( );
|
||||
if ( hadReset ) {
|
||||
UI::Profiler( ).clear( );
|
||||
UI::Profiler( ).startFrame( );
|
||||
UI::Profiler( ).start( "Full frame" );
|
||||
}
|
||||
|
||||
UI::Profiler( ).start( "Debug" );
|
||||
if ( !hadReset ) {
|
||||
UI::Profiler( ).start( "Debug" );
|
||||
}
|
||||
T_Rendertarget::MainOutput( );
|
||||
if ( UI::ODbg( ).isActive( ) ) {
|
||||
UI::ODbg( ).debugOutput( );
|
||||
}
|
||||
UI::Profiler( ).end( "Debug" );
|
||||
if ( !hadReset ) {
|
||||
UI::Profiler( ).end( "Debug" );
|
||||
}
|
||||
|
||||
} else {
|
||||
T_Rendertarget::MainOutput( );
|
||||
|
|
|
@ -23,12 +23,14 @@ bool T_Demo::initialise(
|
|||
return program && runInit( *program );
|
||||
}
|
||||
|
||||
void T_Demo::render( )
|
||||
bool T_Demo::render( )
|
||||
{
|
||||
bool rv = false;
|
||||
if ( Common::Ops( ).hasNewProgram( ) ) {
|
||||
auto nProgram{ Common::Ops( ).program( ) };
|
||||
if ( runInit( *nProgram ) ) {
|
||||
program = std::move( nProgram );
|
||||
rv = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +46,7 @@ void T_Demo::render( )
|
|||
context->aborted = true;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool T_Demo::runInit(
|
||||
|
|
|
@ -16,7 +16,7 @@ struct T_Demo
|
|||
|
||||
bool initialise( const uint32_t width ,
|
||||
const uint32_t height );
|
||||
void render( );
|
||||
bool render( );
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@ void T_Profiler::start(
|
|||
parents_.add( Invalid );
|
||||
}
|
||||
|
||||
assert( previous_ == Invalid || previous_ < pos );
|
||||
chain_[ pos ] = previous_;
|
||||
if ( current_ != Invalid ) {
|
||||
parents_[ pos ] = current_;
|
||||
|
|
Loading…
Reference in a new issue