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).
This commit is contained in:
Lukas Stockner 2016-01-01 23:52:37 +01:00
parent 5c682a901b
commit b1a7fc2c51
2 changed files with 5 additions and 2 deletions

View File

@ -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 {

View File

@ -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++;