Cycles: Check for validity of the tiles arrays in progressive refine

In certain configurations (for example when start resolution is set to small
value for background render and progressive refine enabled) number of tiles
might change in the tile manager. This situation will confuse progressive
refine feature and likely cause crash.

We might also add some settings verification in the session constructor, but
having an assert with brief explanation about what's wrong should already be
much better than nothing.
This commit is contained in:
Sergey Sharybin 2015-05-19 12:31:37 +05:00
parent f868be6295
commit da34136de1

@ -409,6 +409,11 @@ bool Session::acquire_tile(Device *tile_device, RenderTile& rtile)
if(tile_buffers.size() == 0)
tile_buffers.resize(tile_manager.state.num_tiles, NULL);
/* In certain circumstances number of tiles in the tile manager could
* be changed. This is not supported by the progressive refine feature.
*/
assert(tile_buffers.size() == tile_manager.state.num_tiles);
tilebuffers = tile_buffers[tile.index];
if(tilebuffers == NULL) {
tilebuffers = new RenderBuffers(tile_device);