24 return a.
size >
b.size;
30 return a.time >
b.time;
36 return a.sum_samples >
b.sum_samples;
41 return a.samples >
b.samples;
67 const string double_indent = indent + indent;
76 double_indent.c_str(),
87 const string double_indent = indent + indent;
93 "%s%-40s %fs\n", double_indent.c_str(), entry.name.c_str(), entry.time);
126 if (total_samples == 0) {
132 const double sum_percent = 100 * ((double)
sum_samples) / total_samples;
134 const double self_percent = 100 * ((double)
self_samples) / total_samples;
136 const string info =
string_printf(
"%-32s: Total %3.2f%% (%.2fs), Self %3.2f%% (%.2fs)\n",
142 string result = indent + info;
146 result += entry.full_report(indent_level + 1, total_samples);
164 const entry_map::iterator entry =
entries.find(name);
166 entry->second.samples += samples;
167 entry->second.hits += hits;
178 sorted_entries.reserve(
entries.size());
182 for (entry_map::const_reference entry :
entries) {
185 total_hits += pair.
hits;
188 sorted_entries.push_back(pair);
190 const double avg_samples_per_hit = ((double)total_samples) / total_hits;
192 sort(sorted_entries.begin(), sorted_entries.end(), namedSampleCountPairComparator);
196 const double seconds = entry.samples * 0.001;
197 const double relative = ((double)entry.samples) / (entry.hits * avg_samples_per_hit);
201 "%-32s: %.2fs (Relative cost: %.2f)\n", entry.name.c_str(), seconds, relative);
231 result += indent +
"Full Images:\n";
233 sort(sorted_entries.begin(), sorted_entries.end(), namedSizeEntryComparator);
236 double_indent.c_str(),
245 result += indent +
"Tiled Images:\n";
248 double_indent.c_str(),
257 triple_indent.c_str(),
281 result +=
string_printf(
"%sPeak tiled image memory: %s (%s)\n",
287 result +=
string_printf(
"%sOverhead image memory: %s (%s)\n",
299 result +=
string_printf(
"%sPeak total image memory: %s (%s)\n",
314 "%sReloaded: %" PRId64 " (%.1f%%)\n",
316 double_indent.c_str(),
318 double_indent.c_str(),
321 double_indent.c_str(),
324 double_indent.c_str(),
405 result +=
"Profiling information not available (only works with CPU rendering)";
425 result +=
"Object:\n" +
object.full_report(1);
445 object.times.clear();
unsigned long long int uint64_t
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
vector< ImageTileStats > tiled_images
size_t tiled_images_peak_size
ImageEvictionStats eviction
string full_report(const int indent_level=0)
NamedSizeStats full_images
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
int get_device_index() const
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)
void collect_profiling(Scene *scene, Profiler &prof)
NamedSampleCountStats shaders
NamedNestedSampleStats kernel
NamedSampleCountStats objects
UpdateTimeStats background
UpdateTimeStats particles
UpdateTimeStats procedurals
UpdateTimeStats integrator
unique_ptr_vector< Shader > shaders
unique_ptr_vector< Object > objects
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,...)