22 return a.
size >
b.size;
28 return a.time >
b.time;
34 return a.sum_samples >
b.sum_samples;
39 return a.samples >
b.samples;
65 const string double_indent = indent + indent;
74 double_indent.c_str(),
85 const string double_indent = indent + indent;
91 "%s%-40s %fs\n", double_indent.c_str(), entry.name.c_str(), entry.time);
124 if (total_samples == 0) {
130 const double sum_percent = 100 * ((double)
sum_samples) / total_samples;
132 const double self_percent = 100 * ((double)
self_samples) / total_samples;
134 const string info =
string_printf(
"%-32s: Total %3.2f%% (%.2fs), Self %3.2f%% (%.2fs)\n",
140 string result = indent + info;
144 result += entry.full_report(indent_level + 1, total_samples);
162 const entry_map::iterator entry =
entries.find(
name);
164 entry->second.samples += samples;
165 entry->second.hits += hits;
176 sorted_entries.reserve(
entries.size());
180 for (entry_map::const_reference entry :
entries) {
183 total_hits += pair.
hits;
186 sorted_entries.push_back(pair);
188 const double avg_samples_per_hit = ((double)total_samples) / total_hits;
190 sort(sorted_entries.begin(), sorted_entries.end(), namedSampleCountPairComparator);
194 const double seconds = entry.samples * 0.001;
195 const double relative = ((double)entry.samples) / (entry.hits * avg_samples_per_hit);
199 "%-32s: %.2fs (Relative cost: %.2f)\n", entry.name.c_str(), seconds, relative);
212 result += indent +
"Geometry:\n" +
geometry.full_report(indent_level + 1);
224 result += indent +
"Textures:\n" +
textures.full_report(indent_level + 1);
293 result +=
"Mesh statistics:\n" +
mesh.full_report(1);
294 result +=
"Image statistics:\n" +
image.full_report(1);
296 result +=
"Kernel statistics:\n" +
kernel.full_report(1);
301 result +=
"Profiling information not available (only works with CPU rendering)";
310 return times.full_report(indent_level + 1);
321 result +=
"Object:\n" +
object.full_report(1);
341 object.times.clear();
unsigned long long int uint64_t
static DBVT_INLINE btDbvtNode * sort(btDbvtNode *n, btDbvtNode *&r)
string full_report(const int indent_level=0)
string full_report(const int indent_level=0)
vector< NamedNestedSampleStats > entries
NamedNestedSampleStats & add_entry(const string &name, const uint64_t samples)
string full_report(const int indent_level=0, const uint64_t total_samples=0)
NamedSampleCountPair(const ustring &name, const uint64_t samples, const uint64_t hits)
string full_report(const int indent_level=0)
void add(const ustring &name, const uint64_t samples, const uint64_t hits)
void add_entry(const NamedSizeEntry &entry)
string full_report(const int indent_level=0)
vector< NamedSizeEntry > entries
string full_report(const int indent_level=0)
vector< NamedTimeEntry > entries
bool get_shader(const int shader, uint64_t &samples, uint64_t &hits)
uint64_t get_event(ProfilingEvent event)
bool get_object(const int object, uint64_t &samples, uint64_t &hits)
UpdateTimeStats background
UpdateTimeStats particles
UpdateTimeStats procedurals
UpdateTimeStats integrator
string full_report(const int indent_level=0)
#define CCL_NAMESPACE_END
@ PROFILING_SHADE_SURFACE_SETUP
@ PROFILING_SHADE_SHADOW_SURFACE
@ PROFILING_SHADE_VOLUME_INTEGRATE
@ PROFILING_SHADE_SHADOW_VOLUME
@ PROFILING_INTERSECT_SUBSURFACE
@ PROFILING_INTERSECT_SHADOW
@ PROFILING_INTERSECT_CLOSEST
@ PROFILING_INTERSECT_DEDICATED_LIGHT
@ PROFILING_SHADE_VOLUME_SETUP
@ PROFILING_SHADE_SURFACE_EVAL
@ PROFILING_SHADE_SURFACE_INDIRECT_LIGHT
@ PROFILING_SHADE_SURFACE_AO
@ PROFILING_SHADE_SURFACE_DIRECT_LIGHT
@ PROFILING_SHADE_LIGHT_SETUP
@ PROFILING_SHADE_SHADOW_SETUP
@ PROFILING_SHADE_DEDICATED_LIGHT
@ PROFILING_INTERSECT_VOLUME_STACK
@ PROFILING_SHADE_VOLUME_DIRECT_LIGHT
@ PROFILING_SHADE_SURFACE_PASSES
@ PROFILING_SHADE_LIGHT_EVAL
@ PROFILING_SHADE_VOLUME_INDIRECT_LIGHT
static CCL_NAMESPACE_BEGIN int kIndentNumSpaces
string string_human_readable_size(size_t size)
string string_human_readable_number(size_t num)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
int get_device_index() const
void collect_profiling(Scene *scene, Profiler &prof)
NamedSampleCountStats shaders
NamedNestedSampleStats kernel
NamedSampleCountStats objects
unique_ptr_vector< Shader > shaders
unique_ptr_vector< Object > objects