From b41c72b710d4013fd6d67dc49a8ebb2a416b4462 Mon Sep 17 00:00:00 2001 From: Alaska Date: Thu, 25 Nov 2021 09:20:28 +0100 Subject: Fix performance decrease with Scrambling Distance on With the current code in master, scrambling distance is enabled on non-hardware accelerated ray tracing devices see a measurable performance decrease when compared scrambling distance on vs off. From testing, this performance decrease comes from the large tile sizes scheduled in `tile.cpp`. This patch attempts to address the performance decrease by using different algorithms to calculate the tile size for devices with hardware accelerated ray traversal and devices without. Large tile sizes for hardware accelerated devices and small tile sizes for others. Most of this code is based on proposals from @brecht and @leesonw Reviewed By: brecht, leesonw Differential Revision: https://developer.blender.org/D13042 --- intern/cycles/integrator/work_tile_scheduler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'intern/cycles/integrator/work_tile_scheduler.cpp') diff --git a/intern/cycles/integrator/work_tile_scheduler.cpp b/intern/cycles/integrator/work_tile_scheduler.cpp index 2d1ac07db7f..cac573dfeda 100644 --- a/intern/cycles/integrator/work_tile_scheduler.cpp +++ b/intern/cycles/integrator/work_tile_scheduler.cpp @@ -28,6 +28,11 @@ WorkTileScheduler::WorkTileScheduler() { } +void WorkTileScheduler::set_accelerated_rt(bool accelerated_rt) +{ + accelerated_rt_ = accelerated_rt; +} + void WorkTileScheduler::set_max_num_path_states(int max_num_path_states) { max_num_path_states_ = max_num_path_states; @@ -59,7 +64,7 @@ void WorkTileScheduler::reset(const BufferParams &buffer_params, void WorkTileScheduler::reset_scheduler_state() { tile_size_ = tile_calculate_best_size( - image_size_px_, samples_num_, max_num_path_states_, scrambling_distance_); + accelerated_rt_, image_size_px_, samples_num_, max_num_path_states_, scrambling_distance_); VLOG(3) << "Will schedule tiles of size " << tile_size_; -- cgit v1.2.3