2023-06-14 16:52:36 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
2018-07-27 15:46:13 +02:00
|
|
|
|
2021-10-24 14:19:19 +02:00
|
|
|
#include "scene/stats.h"
|
|
|
|
|
#include "scene/object.h"
|
2021-10-24 14:19:19 +02:00
|
|
|
#include "util/algorithm.h"
|
2024-12-26 19:41:25 +01:00
|
|
|
|
2021-10-24 14:19:19 +02:00
|
|
|
#include "util/string.h"
|
2018-07-27 15:46:13 +02:00
|
|
|
|
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
|
|
static int kIndentNumSpaces = 2;
|
|
|
|
|
|
|
|
|
|
/* Named size entry. */
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
bool namedSizeEntryComparator(const NamedSizeEntry &a, const NamedSizeEntry &b)
|
|
|
|
|
{
|
|
|
|
|
/* We sort in descending order. */
|
|
|
|
|
return a.size > b.size;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-01 23:16:01 +02:00
|
|
|
bool namedTimeEntryComparator(const NamedTimeEntry &a, const NamedTimeEntry &b)
|
|
|
|
|
{
|
|
|
|
|
/* We sort in descending order. */
|
|
|
|
|
return a.time > b.time;
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 02:06:30 +01:00
|
|
|
bool namedTimeSampleEntryComparator(const NamedNestedSampleStats &a,
|
|
|
|
|
const NamedNestedSampleStats &b)
|
|
|
|
|
{
|
|
|
|
|
return a.sum_samples > b.sum_samples;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool namedSampleCountPairComparator(const NamedSampleCountPair &a, const NamedSampleCountPair &b)
|
|
|
|
|
{
|
|
|
|
|
return a.samples > b.samples;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-27 15:46:13 +02:00
|
|
|
} // namespace
|
|
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
NamedSizeEntry::NamedSizeEntry() : size(0) {}
|
2018-07-27 15:46:13 +02:00
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
NamedSizeEntry::NamedSizeEntry(const string &name, const size_t size) : name(name), size(size) {}
|
2018-07-27 15:46:13 +02:00
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
NamedTimeEntry::NamedTimeEntry() : time(0) {}
|
2020-10-01 23:16:01 +02:00
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
NamedTimeEntry::NamedTimeEntry(const string &name, const double time) : name(name), time(time) {}
|
2020-10-01 23:16:01 +02:00
|
|
|
|
2018-07-27 15:46:13 +02:00
|
|
|
/* Named size statistics. */
|
|
|
|
|
|
2023-03-29 16:50:54 +02:00
|
|
|
NamedSizeStats::NamedSizeStats() : total_size(0) {}
|
2018-07-27 15:46:13 +02:00
|
|
|
|
|
|
|
|
void NamedSizeStats::add_entry(const NamedSizeEntry &entry)
|
|
|
|
|
{
|
|
|
|
|
total_size += entry.size;
|
|
|
|
|
entries.push_back(entry);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
string NamedSizeStats::full_report(const int indent_level)
|
2018-07-27 15:46:13 +02:00
|
|
|
{
|
|
|
|
|
const string indent(indent_level * kIndentNumSpaces, ' ');
|
|
|
|
|
const string double_indent = indent + indent;
|
2024-12-26 17:53:59 +01:00
|
|
|
string result;
|
2018-07-27 15:46:13 +02:00
|
|
|
result += string_printf("%sTotal memory: %s (%s)\n",
|
|
|
|
|
indent.c_str(),
|
|
|
|
|
string_human_readable_size(total_size).c_str(),
|
|
|
|
|
string_human_readable_number(total_size).c_str());
|
|
|
|
|
sort(entries.begin(), entries.end(), namedSizeEntryComparator);
|
2024-12-26 19:41:25 +01:00
|
|
|
for (const NamedSizeEntry &entry : entries) {
|
2018-07-27 15:46:13 +02:00
|
|
|
result += string_printf("%s%-32s %s (%s)\n",
|
|
|
|
|
double_indent.c_str(),
|
|
|
|
|
entry.name.c_str(),
|
|
|
|
|
string_human_readable_size(entry.size).c_str(),
|
|
|
|
|
string_human_readable_number(entry.size).c_str());
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
string NamedTimeStats::full_report(const int indent_level)
|
2020-10-01 23:16:01 +02:00
|
|
|
{
|
|
|
|
|
const string indent(indent_level * kIndentNumSpaces, ' ');
|
|
|
|
|
const string double_indent = indent + indent;
|
2024-12-26 17:53:59 +01:00
|
|
|
string result;
|
2020-10-01 23:16:01 +02:00
|
|
|
result += string_printf("%sTotal time: %fs\n", indent.c_str(), total_time);
|
|
|
|
|
sort(entries.begin(), entries.end(), namedTimeEntryComparator);
|
2024-12-26 19:41:25 +01:00
|
|
|
for (const NamedTimeEntry &entry : entries) {
|
2020-10-01 23:16:01 +02:00
|
|
|
result += string_printf(
|
|
|
|
|
"%s%-40s %fs\n", double_indent.c_str(), entry.name.c_str(), entry.time);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 02:06:30 +01:00
|
|
|
/* Named time sample statistics. */
|
|
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
NamedNestedSampleStats::NamedNestedSampleStats() : self_samples(0), sum_samples(0) {}
|
2018-11-29 02:06:30 +01:00
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
NamedNestedSampleStats::NamedNestedSampleStats(const string &name, const uint64_t samples)
|
2018-11-29 02:06:30 +01:00
|
|
|
: name(name), self_samples(samples), sum_samples(samples)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NamedNestedSampleStats &NamedNestedSampleStats::add_entry(const string &name_, uint64_t samples_)
|
|
|
|
|
{
|
|
|
|
|
entries.push_back(NamedNestedSampleStats(name_, samples_));
|
|
|
|
|
return entries[entries.size() - 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NamedNestedSampleStats::update_sum()
|
|
|
|
|
{
|
|
|
|
|
sum_samples = self_samples;
|
2024-12-26 19:41:25 +01:00
|
|
|
for (NamedNestedSampleStats &entry : entries) {
|
2018-11-29 02:06:30 +01:00
|
|
|
entry.update_sum();
|
|
|
|
|
sum_samples += entry.sum_samples;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
string NamedNestedSampleStats::full_report(const int indent_level, uint64_t total_samples)
|
2018-11-29 02:06:30 +01:00
|
|
|
{
|
|
|
|
|
update_sum();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-11-29 02:06:30 +01:00
|
|
|
if (total_samples == 0) {
|
|
|
|
|
total_samples = sum_samples;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-11-29 02:06:30 +01:00
|
|
|
const string indent(indent_level * kIndentNumSpaces, ' ');
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-11-29 02:06:30 +01:00
|
|
|
const double sum_percent = 100 * ((double)sum_samples) / total_samples;
|
|
|
|
|
const double sum_seconds = sum_samples * 0.001;
|
|
|
|
|
const double self_percent = 100 * ((double)self_samples) / total_samples;
|
|
|
|
|
const double self_seconds = self_samples * 0.001;
|
2024-12-29 17:32:00 +01:00
|
|
|
const string info = string_printf("%-32s: Total %3.2f%% (%.2fs), Self %3.2f%% (%.2fs)\n",
|
|
|
|
|
name.c_str(),
|
|
|
|
|
sum_percent,
|
|
|
|
|
sum_seconds,
|
|
|
|
|
self_percent,
|
|
|
|
|
self_seconds);
|
2018-11-30 08:38:25 +11:00
|
|
|
string result = indent + info;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-11-29 02:06:30 +01:00
|
|
|
sort(entries.begin(), entries.end(), namedTimeSampleEntryComparator);
|
2024-12-26 19:41:25 +01:00
|
|
|
for (NamedNestedSampleStats &entry : entries) {
|
2018-11-29 02:06:30 +01:00
|
|
|
result += entry.full_report(indent_level + 1, total_samples);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Named sample count pairs. */
|
|
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
NamedSampleCountPair::NamedSampleCountPair(const ustring &name,
|
|
|
|
|
const uint64_t samples,
|
|
|
|
|
const uint64_t hits)
|
2018-11-29 02:06:30 +01:00
|
|
|
: name(name), samples(samples), hits(hits)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
NamedSampleCountStats::NamedSampleCountStats() = default;
|
2018-11-29 02:06:30 +01:00
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
void NamedSampleCountStats::add(const ustring &name, const uint64_t samples, const uint64_t hits)
|
2018-11-29 02:06:30 +01:00
|
|
|
{
|
2024-12-29 17:32:00 +01:00
|
|
|
const entry_map::iterator entry = entries.find(name);
|
2018-11-29 02:06:30 +01:00
|
|
|
if (entry != entries.end()) {
|
|
|
|
|
entry->second.samples += samples;
|
|
|
|
|
entry->second.hits += hits;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
entries.emplace(name, NamedSampleCountPair(name, samples, hits));
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
string NamedSampleCountStats::full_report(const int indent_level)
|
2018-11-29 02:06:30 +01:00
|
|
|
{
|
|
|
|
|
const string indent(indent_level * kIndentNumSpaces, ' ');
|
|
|
|
|
|
|
|
|
|
vector<NamedSampleCountPair> sorted_entries;
|
|
|
|
|
sorted_entries.reserve(entries.size());
|
|
|
|
|
|
2024-12-29 17:32:00 +01:00
|
|
|
uint64_t total_hits = 0;
|
|
|
|
|
uint64_t total_samples = 0;
|
2024-12-26 19:41:25 +01:00
|
|
|
for (entry_map::const_reference entry : entries) {
|
2018-11-29 02:06:30 +01:00
|
|
|
const NamedSampleCountPair &pair = entry.second;
|
|
|
|
|
|
|
|
|
|
total_hits += pair.hits;
|
|
|
|
|
total_samples += pair.samples;
|
|
|
|
|
|
|
|
|
|
sorted_entries.push_back(pair);
|
|
|
|
|
}
|
|
|
|
|
const double avg_samples_per_hit = ((double)total_samples) / total_hits;
|
|
|
|
|
|
|
|
|
|
sort(sorted_entries.begin(), sorted_entries.end(), namedSampleCountPairComparator);
|
|
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
string result;
|
2024-12-26 19:41:25 +01:00
|
|
|
for (const NamedSampleCountPair &entry : sorted_entries) {
|
2018-11-29 02:06:30 +01:00
|
|
|
const double seconds = entry.samples * 0.001;
|
|
|
|
|
const double relative = ((double)entry.samples) / (entry.hits * avg_samples_per_hit);
|
|
|
|
|
|
|
|
|
|
result += indent +
|
|
|
|
|
string_printf(
|
|
|
|
|
"%-32s: %.2fs (Relative cost: %.2f)\n", entry.name.c_str(), seconds, relative);
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-27 15:46:13 +02:00
|
|
|
/* Mesh statistics. */
|
|
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
MeshStats::MeshStats() = default;
|
2018-07-27 15:46:13 +02:00
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
string MeshStats::full_report(const int indent_level)
|
2018-07-27 15:46:13 +02:00
|
|
|
{
|
|
|
|
|
const string indent(indent_level * kIndentNumSpaces, ' ');
|
2024-12-26 17:53:59 +01:00
|
|
|
string result;
|
2018-07-27 15:46:13 +02:00
|
|
|
result += indent + "Geometry:\n" + geometry.full_report(indent_level + 1);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Image statistics. */
|
|
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
ImageStats::ImageStats() = default;
|
2018-07-27 15:46:13 +02:00
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
string ImageStats::full_report(const int indent_level)
|
2018-07-27 15:46:13 +02:00
|
|
|
{
|
|
|
|
|
const string indent(indent_level * kIndentNumSpaces, ' ');
|
2024-12-26 17:53:59 +01:00
|
|
|
string result;
|
2018-07-27 15:46:13 +02:00
|
|
|
result += indent + "Textures:\n" + textures.full_report(indent_level + 1);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Overall statistics. */
|
|
|
|
|
|
|
|
|
|
RenderStats::RenderStats()
|
|
|
|
|
{
|
2018-11-29 02:06:30 +01:00
|
|
|
has_profiling = false;
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-29 23:30:17 +01:00
|
|
|
void RenderStats::collect_profiling(Scene *scene, Profiler &prof)
|
2018-11-29 02:06:30 +01:00
|
|
|
{
|
|
|
|
|
has_profiling = true;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-11-29 02:06:30 +01:00
|
|
|
kernel = NamedNestedSampleStats("Total render time", prof.get_event(PROFILING_UNKNOWN));
|
|
|
|
|
kernel.add_entry("Ray setup", prof.get_event(PROFILING_RAY_SETUP));
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
kernel.add_entry("Intersect Closest", prof.get_event(PROFILING_INTERSECT_CLOSEST));
|
|
|
|
|
kernel.add_entry("Intersect Shadow", prof.get_event(PROFILING_INTERSECT_SHADOW));
|
|
|
|
|
kernel.add_entry("Intersect Subsurface", prof.get_event(PROFILING_INTERSECT_SUBSURFACE));
|
|
|
|
|
kernel.add_entry("Intersect Volume Stack", prof.get_event(PROFILING_INTERSECT_VOLUME_STACK));
|
2023-05-24 13:36:13 +02:00
|
|
|
kernel.add_entry("Intersect Blocked Light", prof.get_event(PROFILING_INTERSECT_DEDICATED_LIGHT));
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
|
|
|
|
NamedNestedSampleStats &surface = kernel.add_entry("Shade Surface", 0);
|
|
|
|
|
surface.add_entry("Setup", prof.get_event(PROFILING_SHADE_SURFACE_SETUP));
|
|
|
|
|
surface.add_entry("Shader Evaluation", prof.get_event(PROFILING_SHADE_SURFACE_EVAL));
|
|
|
|
|
surface.add_entry("Render Passes", prof.get_event(PROFILING_SHADE_SURFACE_PASSES));
|
|
|
|
|
surface.add_entry("Direct Light", prof.get_event(PROFILING_SHADE_SURFACE_DIRECT_LIGHT));
|
|
|
|
|
surface.add_entry("Indirect Light", prof.get_event(PROFILING_SHADE_SURFACE_INDIRECT_LIGHT));
|
|
|
|
|
surface.add_entry("Ambient Occlusion", prof.get_event(PROFILING_SHADE_SURFACE_AO));
|
|
|
|
|
|
|
|
|
|
NamedNestedSampleStats &volume = kernel.add_entry("Shade Volume", 0);
|
|
|
|
|
volume.add_entry("Setup", prof.get_event(PROFILING_SHADE_VOLUME_SETUP));
|
|
|
|
|
volume.add_entry("Integrate", prof.get_event(PROFILING_SHADE_VOLUME_INTEGRATE));
|
|
|
|
|
volume.add_entry("Direct Light", prof.get_event(PROFILING_SHADE_VOLUME_DIRECT_LIGHT));
|
|
|
|
|
volume.add_entry("Indirect Light", prof.get_event(PROFILING_SHADE_VOLUME_INDIRECT_LIGHT));
|
|
|
|
|
|
|
|
|
|
NamedNestedSampleStats &shadow = kernel.add_entry("Shade Shadow", 0);
|
|
|
|
|
shadow.add_entry("Setup", prof.get_event(PROFILING_SHADE_SHADOW_SETUP));
|
|
|
|
|
shadow.add_entry("Surface", prof.get_event(PROFILING_SHADE_SHADOW_SURFACE));
|
|
|
|
|
shadow.add_entry("Volume", prof.get_event(PROFILING_SHADE_SHADOW_VOLUME));
|
2023-05-24 13:36:13 +02:00
|
|
|
shadow.add_entry("Blocked Light", prof.get_event(PROFILING_SHADE_DEDICATED_LIGHT));
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
|
|
|
|
NamedNestedSampleStats &light = kernel.add_entry("Shade Light", 0);
|
|
|
|
|
light.add_entry("Setup", prof.get_event(PROFILING_SHADE_LIGHT_SETUP));
|
|
|
|
|
light.add_entry("Shader Evaluation", prof.get_event(PROFILING_SHADE_LIGHT_EVAL));
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-11-29 02:06:30 +01:00
|
|
|
shaders.entries.clear();
|
2024-12-26 19:41:25 +01:00
|
|
|
for (Shader *shader : scene->shaders) {
|
2024-12-29 17:32:00 +01:00
|
|
|
uint64_t samples;
|
|
|
|
|
uint64_t hits;
|
2018-11-29 02:06:30 +01:00
|
|
|
if (prof.get_shader(shader->id, samples, hits)) {
|
|
|
|
|
shaders.add(shader->name, samples, hits);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
|
2018-11-29 02:06:30 +01:00
|
|
|
objects.entries.clear();
|
2024-12-26 19:41:25 +01:00
|
|
|
for (Object *object : scene->objects) {
|
2024-12-29 17:32:00 +01:00
|
|
|
uint64_t samples;
|
|
|
|
|
uint64_t hits;
|
2018-11-29 02:06:30 +01:00
|
|
|
if (prof.get_object(object->get_device_index(), samples, hits)) {
|
|
|
|
|
objects.add(object->name, samples, hits);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-27 15:46:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string RenderStats::full_report()
|
|
|
|
|
{
|
2024-12-26 17:53:59 +01:00
|
|
|
string result;
|
2018-07-27 15:46:13 +02:00
|
|
|
result += "Mesh statistics:\n" + mesh.full_report(1);
|
|
|
|
|
result += "Image statistics:\n" + image.full_report(1);
|
2018-11-29 02:06:30 +01:00
|
|
|
if (has_profiling) {
|
|
|
|
|
result += "Kernel statistics:\n" + kernel.full_report(1);
|
|
|
|
|
result += "Shader statistics:\n" + shaders.full_report(1);
|
|
|
|
|
result += "Object statistics:\n" + objects.full_report(1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
result += "Profiling information not available (only works with CPU rendering)";
|
|
|
|
|
}
|
2018-07-27 15:46:13 +02:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-29 16:50:54 +02:00
|
|
|
NamedTimeStats::NamedTimeStats() : total_time(0.0) {}
|
2020-10-01 23:16:01 +02:00
|
|
|
|
2025-01-01 18:15:54 +01:00
|
|
|
string UpdateTimeStats::full_report(const int indent_level)
|
2020-10-01 23:16:01 +02:00
|
|
|
{
|
|
|
|
|
return times.full_report(indent_level + 1);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-26 17:53:59 +01:00
|
|
|
SceneUpdateStats::SceneUpdateStats() = default;
|
2020-10-01 23:16:01 +02:00
|
|
|
|
|
|
|
|
string SceneUpdateStats::full_report()
|
|
|
|
|
{
|
2024-12-26 17:53:59 +01:00
|
|
|
string result;
|
2020-10-01 23:16:01 +02:00
|
|
|
result += "Scene:\n" + scene.full_report(1);
|
|
|
|
|
result += "Geometry:\n" + geometry.full_report(1);
|
|
|
|
|
result += "Light:\n" + light.full_report(1);
|
|
|
|
|
result += "Object:\n" + object.full_report(1);
|
|
|
|
|
result += "Image:\n" + image.full_report(1);
|
|
|
|
|
result += "Background:\n" + background.full_report(1);
|
|
|
|
|
result += "Bake:\n" + bake.full_report(1);
|
|
|
|
|
result += "Camera:\n" + camera.full_report(1);
|
|
|
|
|
result += "Film:\n" + film.full_report(1);
|
|
|
|
|
result += "Integrator:\n" + integrator.full_report(1);
|
|
|
|
|
result += "OSL:\n" + osl.full_report(1);
|
|
|
|
|
result += "Particles:\n" + particles.full_report(1);
|
|
|
|
|
result += "SVM:\n" + svm.full_report(1);
|
|
|
|
|
result += "Tables:\n" + tables.full_report(1);
|
2021-01-25 14:56:57 +01:00
|
|
|
result += "Procedurals:\n" + procedurals.full_report(1);
|
2020-10-01 23:16:01 +02:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SceneUpdateStats::clear()
|
|
|
|
|
{
|
2020-10-08 06:41:33 +02:00
|
|
|
geometry.times.clear();
|
|
|
|
|
image.times.clear();
|
|
|
|
|
light.times.clear();
|
|
|
|
|
object.times.clear();
|
|
|
|
|
background.times.clear();
|
|
|
|
|
bake.times.clear();
|
|
|
|
|
camera.times.clear();
|
|
|
|
|
film.times.clear();
|
|
|
|
|
integrator.times.clear();
|
|
|
|
|
osl.times.clear();
|
|
|
|
|
particles.times.clear();
|
|
|
|
|
scene.times.clear();
|
|
|
|
|
svm.times.clear();
|
|
|
|
|
tables.times.clear();
|
2021-01-25 14:56:57 +01:00
|
|
|
procedurals.times.clear();
|
2020-10-01 23:16:01 +02:00
|
|
|
}
|
|
|
|
|
|
2018-07-27 15:46:13 +02:00
|
|
|
CCL_NAMESPACE_END
|