[Bf-blender-cvs] [b1a7fc2] master: Cycles: Force bottom-to-top tile order for viewport rendering

Lukas Stockner noreply at git.blender.org
Sat Jan 2 01:16:44 CET 2016


Commit: b1a7fc2c51f7c05babce6b99a1c47572906e253c
Author: Lukas Stockner
Date:   Fri Jan 1 23:52:37 2016 +0100
Branches: master
https://developer.blender.org/rBb1a7fc2c51f7c05babce6b99a1c47572906e253c

Cycles: Force bottom-to-top tile order for viewport rendering

This commit overrides the user's choice of tile order in the case of viewport rendering and always uses bottom-to-top instead.
This was already done until the TileManager redesign, but since it removed the distinction between viewport and regular rendering
in the manager, the viewport was now also using the selected order. Since this requires sorting of the generated tiles,
it slows down rendering a bit. With the forced bottom-to-top order, this sorting step can now be avoided again.

Since the tile order is invisible anyways for viewport rendering, this commit won't have any impact on users (apart from a slight speedup).

===================================================================

M	intern/cycles/blender/blender_sync.cpp
M	intern/cycles/render/tile.cpp

===================================================================

diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index 4b2fa61..8180aa0 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -554,7 +554,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine,
 		params.tile_size = make_int2(tile_x, tile_y);
 	}
 
-	if(BlenderSession::headless == false) {
+	if((BlenderSession::headless == false) && background) {
 		params.tile_order = (TileOrder)RNA_enum_get(&cscene, "tile_order");
 	}
 	else {
diff --git a/intern/cycles/render/tile.cpp b/intern/cycles/render/tile.cpp
index 14fd89e..37b9647 100644
--- a/intern/cycles/render/tile.cpp
+++ b/intern/cycles/render/tile.cpp
@@ -155,7 +155,10 @@ int TileManager::gen_tiles(bool sliced)
 					cur_tiles++;
 
 					if(cur_tiles == tiles_per_device) {
-						tile_list->sort(TileComparator(tile_order, center));
+						/* Tiles are already generated in Bottom-to-Top order, so no sort is necessary in that case. */
+						if(tile_order != TILE_BOTTOM_TO_TOP) {
+							tile_list->sort(TileComparator(tile_order, center));
+						}
 						tile_list++;
 						cur_tiles = 0;
 						cur_device++;




More information about the Bf-blender-cvs mailing list