Fixed profiler

This commit is contained in:
Emmanuel BENOîT 2017-10-04 18:08:37 +02:00
parent 49663217e2
commit 32dd23abf1
4 changed files with 10 additions and 10 deletions

View file

@ -7,8 +7,8 @@ namespace {
static const std::string Name_( "BLOOOOM!" ); static const std::string Name_( "BLOOOOM!" );
} }
#define PSTART() T_Profiler::Profiler.start( Name_ ) #define PSTART() Globals::Profiler( ).start( Name_ )
#define PEND() do { glFinish( ); T_Profiler::Profiler.end( Name_ ); } while ( 0 ) #define PEND() do { glFinish( ); Globals::Profiler( ).end( Name_ ); } while ( 0 )
T_BloomPass::T_BloomPass( T_BloomPass::T_BloomPass(

View file

@ -8,8 +8,8 @@ namespace {
static const std::string Name_( "Combine" ); static const std::string Name_( "Combine" );
} }
#define PSTART() T_Profiler::Profiler.start( Name_ ) #define PSTART() Globals::Profiler( ).start( Name_ )
#define PEND() do { glFinish( ); T_Profiler::Profiler.end( Name_ ); } while ( 0 ) #define PEND() do { glFinish( ); Globals::Profiler( ).end( Name_ ); } while ( 0 )
T_CombinePass::T_CombinePass( T_CombinePass::T_CombinePass(

4
dof.cc
View file

@ -7,8 +7,8 @@ namespace {
static const std::string Name_( "DoF" ); static const std::string Name_( "DoF" );
} }
#define PSTART() T_Profiler::Profiler.start( Name_ ) #define PSTART() Globals::Profiler( ).start( Name_ )
#define PEND() do { glFinish( ); T_Profiler::Profiler.end( Name_ ); } while ( 0 ) #define PEND() do { glFinish( ); Globals::Profiler( ).end( Name_ ); } while ( 0 )
T_DoFPass::T_DoFPass( T_DoFPass::T_DoFPass(

View file

@ -8,8 +8,8 @@ namespace {
static const std::string Name_( "Raymarcher" ); static const std::string Name_( "Raymarcher" );
} }
#define PSTART() T_Profiler::Profiler.start( Name_ ) #define PSTART() Globals::Profiler( ).start( Name_ )
#define PEND() do { glFinish( ); T_Profiler::Profiler.end( Name_ ); } while ( 0 ) #define PEND() do { glFinish( ); Globals::Profiler( ).end( Name_ ); } while ( 0 )
T_Raymarcher::T_Raymarcher( T_Raymarcher::T_Raymarcher(
@ -30,13 +30,13 @@ T_Raymarcher::T_Raymarcher(
void T_Raymarcher::render( ) void T_Raymarcher::render( )
{ {
PSTART( );
if ( !rtOutput_.activate( ) || !program_.valid( ) ) { if ( !rtOutput_.activate( ) || !program_.valid( ) ) {
glClearColor( 0 , 0 , 0 , 1 ); glClearColor( 0 , 0 , 0 , 1 );
glClear( GL_COLOR_BUFFER_BIT ); glClear( GL_COLOR_BUFFER_BIT );
PEND( );
return; return;
} }
PSTART( );
program_.enable( ); program_.enable( );
glClearColor( 0 , 0 , 0 , 1 ); glClearColor( 0 , 0 , 0 , 1 );