Fix T92601: Disable profiling when the profiler is deemed not active.
Adds a method to profiler that can be used to check if it is active. This is used to determine if stop_profiling and start_profiling should be called. | patch | Juans Scene UI 256 samples | Juans Scene bg 256 samples | junkshop UI | junkshop bg | | No patch | 6:16.59 | 4:05.37 | 2:08.48 | 1:59.7 | | D13187 | 4:12.15 | 3:57.36 | 2:07.25 | 1:58.16 | | D13185 | 4.11.18 |3:54.74 | 2:07.44 | 1:58.03 | | D13190 | 4:12.39 | 3:55.42 | 2:07.62 | 1:58.68 | UI - means rendered from within Blender bg - means rendered from the command line using ##blender -b scene.blend -f 1## Reviewed By: sergey, brecht Maniphest Tasks: T92601 Differential Revision: https://developer.blender.org/D13190
This commit is contained in:
parent
1061f5a1ba
commit
456876208b
Notes:
blender-bot
2023-02-14 07:30:31 +01:00
Referenced by issue #92601, Super LOW performance on CPU rendering in complex scene
|
@ -77,8 +77,10 @@ void PathTraceWorkCPU::render_samples(RenderStatistics &statistics,
|
|||
const int64_t image_height = effective_buffer_params_.height;
|
||||
const int64_t total_pixels_num = image_width * image_height;
|
||||
|
||||
for (CPUKernelThreadGlobals &kernel_globals : kernel_thread_globals_) {
|
||||
kernel_globals.start_profiling();
|
||||
if (device_->profiler.active()) {
|
||||
for (CPUKernelThreadGlobals &kernel_globals : kernel_thread_globals_) {
|
||||
kernel_globals.start_profiling();
|
||||
}
|
||||
}
|
||||
|
||||
tbb::task_arena local_arena = local_tbb_arena_create(device_);
|
||||
|
@ -106,9 +108,10 @@ void PathTraceWorkCPU::render_samples(RenderStatistics &statistics,
|
|||
render_samples_full_pipeline(kernel_globals, work_tile, samples_num);
|
||||
});
|
||||
});
|
||||
|
||||
for (CPUKernelThreadGlobals &kernel_globals : kernel_thread_globals_) {
|
||||
kernel_globals.stop_profiling();
|
||||
if (device_->profiler.active()) {
|
||||
for (CPUKernelThreadGlobals &kernel_globals : kernel_thread_globals_) {
|
||||
kernel_globals.stop_profiling();
|
||||
}
|
||||
}
|
||||
|
||||
statistics.occupancy = 1.0f;
|
||||
|
|
|
@ -171,4 +171,9 @@ bool Profiler::get_object(int object, uint64_t &samples, uint64_t &hits)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Profiler::active() const
|
||||
{
|
||||
return (worker != nullptr);
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
|
|
@ -96,6 +96,8 @@ class Profiler {
|
|||
bool get_shader(int shader, uint64_t &samples, uint64_t &hits);
|
||||
bool get_object(int object, uint64_t &samples, uint64_t &hits);
|
||||
|
||||
bool active() const;
|
||||
|
||||
protected:
|
||||
void run();
|
||||
|
||||
|
|
Loading…
Reference in New Issue