Blender V5.0
Profiler Class Reference

#include <profiling.h>

Public Member Functions

 Profiler ()
 ~Profiler ()
void reset (const int num_shaders, const int num_objects)
void start ()
void stop ()
void add_state (ProfilingState *state)
void remove_state (ProfilingState *state)
uint64_t get_event (ProfilingEvent event)
bool get_shader (const int shader, uint64_t &samples, uint64_t &hits)
bool get_object (const int object, uint64_t &samples, uint64_t &hits)
bool active () const

Protected Member Functions

void run ()

Protected Attributes

vector< uint64_tevent_samples
vector< uint64_tshader_samples
vector< uint64_tobject_samples
vector< uint64_tshader_hits
vector< uint64_tobject_hits
volatile bool do_stop_worker
unique_ptr< threadworker
thread_mutex mutex
vector< ProfilingState * > states

Detailed Description

Definition at line 71 of file profiling.h.

Constructor & Destructor Documentation

◆ Profiler()

CCL_NAMESPACE_BEGIN Profiler::Profiler ( )

Definition at line 14 of file profiling.cpp.

References do_stop_worker, and true.

◆ ~Profiler()

Profiler::~Profiler ( )

Definition at line 16 of file profiling.cpp.

References assert, and worker.

Member Function Documentation

◆ active()

bool Profiler::active ( ) const

Definition at line 161 of file profiling.cpp.

References worker.

◆ add_state()

void Profiler::add_state ( ProfilingState * state)

Definition at line 94 of file profiling.cpp.

References assert, lock, mutex, object_hits, PROFILING_UNKNOWN, shader_hits, state, and states.

◆ get_event()

uint64_t Profiler::get_event ( ProfilingEvent event)

Definition at line 133 of file profiling.cpp.

References assert, event_samples, and worker.

Referenced by RenderStats::collect_profiling().

◆ get_object()

bool Profiler::get_object ( const int object,
uint64_t & samples,
uint64_t & hits )

Definition at line 150 of file profiling.cpp.

References assert, object_hits, object_samples, and worker.

Referenced by RenderStats::collect_profiling().

◆ get_shader()

bool Profiler::get_shader ( const int shader,
uint64_t & samples,
uint64_t & hits )

Definition at line 139 of file profiling.cpp.

References assert, shader_hits, shader_samples, and worker.

Referenced by RenderStats::collect_profiling().

◆ remove_state()

void Profiler::remove_state ( ProfilingState * state)

Definition at line 113 of file profiling.cpp.

References assert, i, lock, mutex, object_hits, shader_hits, state, and states.

◆ reset()

void Profiler::reset ( const int num_shaders,
const int num_objects )

◆ run()

void Profiler::run ( )
protected

Definition at line 21 of file profiling.cpp.

References do_stop_worker, event_samples, lock, mutex, object_samples, PROFILING_NUM_EVENTS, shader_samples, state, and states.

Referenced by start().

◆ start()

void Profiler::start ( )

Definition at line 77 of file profiling.cpp.

References assert, do_stop_worker, run(), and worker.

Referenced by reset().

◆ stop()

void Profiler::stop ( )

Definition at line 84 of file profiling.cpp.

References do_stop_worker, and worker.

Referenced by reset().

Member Data Documentation

◆ do_stop_worker

volatile bool Profiler::do_stop_worker
protected

Definition at line 107 of file profiling.h.

Referenced by Profiler(), run(), start(), and stop().

◆ event_samples

vector<uint64_t> Profiler::event_samples
protected

Definition at line 96 of file profiling.h.

Referenced by get_event(), reset(), and run().

◆ mutex

thread_mutex Profiler::mutex
protected

Definition at line 110 of file profiling.h.

Referenced by add_state(), remove_state(), and run().

◆ object_hits

vector<uint64_t> Profiler::object_hits
protected

Definition at line 105 of file profiling.h.

Referenced by add_state(), get_object(), remove_state(), and reset().

◆ object_samples

vector<uint64_t> Profiler::object_samples
protected

Definition at line 98 of file profiling.h.

Referenced by get_object(), reset(), and run().

◆ shader_hits

vector<uint64_t> Profiler::shader_hits
protected

Definition at line 104 of file profiling.h.

Referenced by add_state(), get_shader(), remove_state(), and reset().

◆ shader_samples

vector<uint64_t> Profiler::shader_samples
protected

Definition at line 97 of file profiling.h.

Referenced by get_shader(), reset(), and run().

◆ states

vector<ProfilingState *> Profiler::states
protected

Definition at line 111 of file profiling.h.

Referenced by add_state(), remove_state(), and run().

◆ worker

unique_ptr<thread> Profiler::worker
protected

Definition at line 108 of file profiling.h.

Referenced by active(), get_event(), get_object(), get_shader(), reset(), start(), stop(), and ~Profiler().


The documentation for this class was generated from the following files: