Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-11-18 16:33:21 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-18 16:33:43 +0300
commitc0d52db783eb3a6288c9af04298b2358fec76357 (patch)
tree7a94549ce03451bfb5e19ac1fb376cf7ce7c092f /intern/cycles/session
parent2b63a76041c0ba6c1fe19d0b343d3e70af4d4f59 (diff)
parentf71813204c405821bb2efb8e4ad65d240d390eaf (diff)
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'intern/cycles/session')
-rw-r--r--intern/cycles/session/session.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/intern/cycles/session/session.cpp b/intern/cycles/session/session.cpp
index aa58a039ed1..af5c6b3f1fd 100644
--- a/intern/cycles/session/session.cpp
+++ b/intern/cycles/session/session.cpp
@@ -368,14 +368,26 @@ void Session::draw()
int2 Session::get_effective_tile_size() const
{
+ const int image_width = buffer_params_.width;
+ const int image_height = buffer_params_.height;
+
/* No support yet for baking with tiles. */
if (!params.use_auto_tile || scene->bake_manager->get_baking()) {
- return make_int2(buffer_params_.width, buffer_params_.height);
+ return make_int2(image_width, image_height);
}
- /* TODO(sergey): Take available memory into account, and if there is enough memory do not tile
- * and prefer optimal performance. */
+ const int64_t image_area = static_cast<int64_t>(image_width) * image_height;
+
+ /* TODO(sergey): Take available memory into account, and if there is enough memory do not
+ * tile and prefer optimal performance. */
+
const int tile_size = tile_manager_.compute_render_tile_size(params.tile_size);
+ const int64_t actual_tile_area = static_cast<int64_t>(tile_size) * tile_size;
+
+ if (actual_tile_area >= image_area) {
+ return make_int2(image_width, image_height);
+ }
+
return make_int2(tile_size, tile_size);
}