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:
authorLukas Stockner <lukas.stockner@freenet.de>2015-12-22 14:51:27 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2015-12-23 15:14:36 +0300
commit548eb9eb4bdd20946e89d50c7b8a079e9b8b143b (patch)
tree534d536b25ea80cfb5c76221d4f447be71566228 /intern/cycles/render/tile.h
parent9e6a22c7e07e21c7ad3dedc9f09f9ac2933566c9 (diff)
Cycles: Sort tiles in rendering order at construction time
This commit modifies the TileManager to sort render tiles once after tiling the image, instead of searching the next tile every time a new tile is acquired by a device. This makes acquiring a tile run in constant time, therefore the render time is linear w.r.t. the amount of tiles, instead of the quadratic dependency before. Furthermore, each (logical) device now has its own Tile list, which makes acquiring a tile for a specific device easier. Also, some code in the TileManager was deduplicated. Reviewers: dingto, sergey Differential Revision: https://developer.blender.org/D1684
Diffstat (limited to 'intern/cycles/render/tile.h')
-rw-r--r--intern/cycles/render/tile.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/intern/cycles/render/tile.h b/intern/cycles/render/tile.h
index c9bdc86f029..09e1b25dda7 100644
--- a/intern/cycles/render/tile.h
+++ b/intern/cycles/render/tile.h
@@ -31,13 +31,12 @@ public:
int index;
int x, y, w, h;
int device;
- bool rendering;
Tile()
{}
Tile(int index_, int x_, int y_, int w_, int h_, int device_)
- : index(index_), x(x_), y(y_), w(w_), h(h_), device(device_), rendering(false) {}
+ : index(index_), x(x_), y(y_), w(w_), h(h_), device(device_) {}
};
/* Tile order */
@@ -64,7 +63,9 @@ public:
int resolution_divider;
int num_tiles;
int num_rendered_tiles;
- list<Tile> tiles;
+ /* This vector contains a list of tiles for every logical device in the session.
+ * In each list, the tiles are sorted according to the tile order setting. */
+ vector<list<Tile> > tiles;
} state;
int num_samples;
@@ -78,7 +79,7 @@ public:
bool next();
bool next_tile(Tile& tile, int device = 0);
bool done();
-
+
void set_tile_order(TileOrder tile_order_) { tile_order = tile_order_; }
protected:
@@ -109,17 +110,8 @@ protected:
*/
bool background;
- /* splits image into tiles and assigns equal amount of tiles to every render device */
- void gen_tiles_global();
-
- /* slices image into as much pieces as how many devices are rendering this image */
- void gen_tiles_sliced();
-
- /* returns tiles for background render */
- list<Tile>::iterator next_background_tile(int device, TileOrder tile_order);
-
- /* returns first unhandled tile for viewport render */
- list<Tile>::iterator next_viewport_tile(int device);
+ /* Generate tile list, return number of tiles. */
+ int gen_tiles(bool sliced);
};
CCL_NAMESPACE_END