21 return a.size >
b.size;
27 return a.time >
b.time;
33 return a.sum_samples >
b.sum_samples;
38 return a.samples >
b.samples;
74 const string double_indent = indent + indent;
83 double_indent.c_str(),
94 const string double_indent = indent + indent;
100 "%s%-40s %fs\n", double_indent.c_str(), entry.
name.c_str(), entry.
time);
112 : name(name), self_samples(samples), sum_samples(samples)
135 if (total_samples == 0) {
145 string info =
string_printf(
"%-32s: Total %3.2f%% (%.2fs), Self %3.2f%% (%.2fs)\n",
151 string result = indent + info;
163 : name(name), samples(samples), hits(hits)
173 entry_map::iterator entry =
entries.find(name);
175 entry->second.samples += samples;
176 entry->second.hits += hits;
187 sorted_entries.reserve(
entries.size());
189 uint64_t total_hits = 0, total_samples = 0;
190 foreach (entry_map::const_reference entry,
entries) {
193 total_hits += pair.
hits;
196 sorted_entries.push_back(pair);
198 const double avg_samples_per_hit = ((
double)total_samples) / total_hits;
200 sort(sorted_entries.begin(), sorted_entries.end(), namedSampleCountPairComparator);
204 const double seconds = entry.samples * 0.001;
205 const double relative = ((
double)entry.samples) / (entry.hits * avg_samples_per_hit);
209 "%-32s: %.2fs (Relative cost: %.2f)\n", entry.name.c_str(), seconds, relative);
311 result +=
"Profiling information not available (only works with CPU rendering)";
335 result +=
"Object:\n" +
object.full_report(1);
355 object.times.clear();
typedef double(DMatrix)[4][4]
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
string full_report(int indent_level=0)
string full_report(int indent_level=0)
string full_report(int indent_level=0, uint64_t total_samples=0)
vector< NamedNestedSampleStats > entries
NamedNestedSampleStats & add_entry(const string &name, uint64_t samples)
NamedSampleCountPair(const ustring &name, uint64_t samples, uint64_t hits)
string full_report(int indent_level=0)
void add(const ustring &name, uint64_t samples, uint64_t hits)
void add_entry(const NamedSizeEntry &entry)
string full_report(int indent_level=0)
vector< NamedSizeEntry > entries
string full_report(int indent_level=0)
vector< NamedTimeEntry > entries
uint64_t get_event(ProfilingEvent event)
bool get_shader(int shader, uint64_t &samples, uint64_t &hits)
bool get_object(int object, uint64_t &samples, uint64_t &hits)
UpdateTimeStats background
UpdateTimeStats particles
UpdateTimeStats procedurals
UpdateTimeStats integrator
string full_report(int indent_level=0)
#define CCL_NAMESPACE_END
struct @211::@212 surface
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static CCL_NAMESPACE_BEGIN int kIndentNumSpaces
unsigned __int64 uint64_t
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
vector< Shader * > shaders
vector< Object * > objects
@ 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_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_INTERSECT_VOLUME_STACK
@ PROFILING_SHADE_VOLUME_DIRECT_LIGHT
@ PROFILING_SHADE_SURFACE_PASSES
@ PROFILING_SHADE_LIGHT_EVAL
@ PROFILING_SHADE_VOLUME_INDIRECT_LIGHT