Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/tile.h
| Show All 25 Lines | |||||
| /* Tile */ | /* Tile */ | ||||
| class Tile { | class Tile { | ||||
| public: | public: | ||||
| int index; | int index; | ||||
| int x, y, w, h; | int x, y, w, h; | ||||
| int device; | int device; | ||||
| bool rendering; | |||||
| Tile() | Tile() | ||||
| {} | {} | ||||
| Tile(int index_, int x_, int y_, int w_, int h_, int device_) | 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 */ | /* Tile order */ | ||||
| /* Note: this should match enum_tile_order in properties.py */ | /* Note: this should match enum_tile_order in properties.py */ | ||||
| enum TileOrder { | enum TileOrder { | ||||
| TILE_CENTER = 0, | TILE_CENTER = 0, | ||||
| TILE_RIGHT_TO_LEFT = 1, | TILE_RIGHT_TO_LEFT = 1, | ||||
| Show All 10 Lines | public: | ||||
| struct State { | struct State { | ||||
| BufferParams buffer; | BufferParams buffer; | ||||
| int sample; | int sample; | ||||
| int num_samples; | int num_samples; | ||||
| int resolution_divider; | int resolution_divider; | ||||
| int num_tiles; | int num_tiles; | ||||
| int num_rendered_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. */ | |||||
sergey: Fullstop. | |||||
| vector<list<Tile> > tiles; | |||||
Done Inline ActionsPlease do comment such non-intuitive mappings. sergey: Please do comment such non-intuitive mappings.
Also not really sure why it should be a pointer… | |||||
Not Done Inline ActionsI went for pointers to avoid copying the list when pushing it into the vector, but with the resize approach you mentioned below, that's not necessary anymore lukasstockner97: I went for pointers to avoid copying the list when pushing it into the vector, but with the… | |||||
| } state; | } state; | ||||
| int num_samples; | int num_samples; | ||||
| TileManager(bool progressive, int num_samples, int2 tile_size, int start_resolution, | TileManager(bool progressive, int num_samples, int2 tile_size, int start_resolution, | ||||
| bool preserve_tile_device, bool background, TileOrder tile_order, int num_devices = 1); | bool preserve_tile_device, bool background, TileOrder tile_order, int num_devices = 1); | ||||
| ~TileManager(); | ~TileManager(); | ||||
| void reset(BufferParams& params, int num_samples); | void reset(BufferParams& params, int num_samples); | ||||
| void set_samples(int num_samples); | void set_samples(int num_samples); | ||||
| bool next(); | bool next(); | ||||
| bool next_tile(Tile& tile, int device = 0); | bool next_tile(Tile& tile, int device = 0); | ||||
| bool done(); | bool done(); | ||||
| void set_tile_order(TileOrder tile_order_) { tile_order = tile_order_; } | void set_tile_order(TileOrder tile_order_) { tile_order = tile_order_; } | ||||
| protected: | protected: | ||||
| void set_tiles(); | void set_tiles(); | ||||
Not Done Inline ActionsPerhaps you misunderstood the note. What i meant is:
sergey: Perhaps you misunderstood the note. What i meant is:
- TileComparator is to have protected… | |||||
| bool progressive; | bool progressive; | ||||
| int2 tile_size; | int2 tile_size; | ||||
| TileOrder tile_order; | TileOrder tile_order; | ||||
| int start_resolution; | int start_resolution; | ||||
| int num_devices; | int num_devices; | ||||
| /* in some cases it is important that the same tile will be returned for the same | /* in some cases it is important that the same tile will be returned for the same | ||||
| Show All 10 Lines | protected: | ||||
| * assigning to render devices | * assigning to render devices | ||||
| * | * | ||||
| * however viewport rendering expects tiles to be allocated in a special way, | * however viewport rendering expects tiles to be allocated in a special way, | ||||
| * meaning image is being sliced horizontally first and every device handles | * meaning image is being sliced horizontally first and every device handles | ||||
| * it's own slice | * it's own slice | ||||
| */ | */ | ||||
| bool background; | bool background; | ||||
| /* splits image into tiles and assigns equal amount of tiles to every render device */ | /* Generate tile list, return number of tiles. */ | ||||
| void gen_tiles_global(); | int gen_tiles(bool sliced); | ||||
Not Done Inline ActionsFullstop. sergey: Fullstop. | |||||
| /* 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); | |||||
| }; | }; | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif /* __TILE_H__ */ | #endif /* __TILE_H__ */ | ||||
Fullstop.