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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-10-23 20:36:53 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-10-23 20:36:53 +0400
commit933864da1886f3e61a7233949de8f1dbbc89e1c5 (patch)
tree53919ee0966d8b571ff5310ef9300cb7b9a9a14f /intern/cycles/render/tile.h
parente038a1c613009d81adda0662dbb1e4a38228909a (diff)
Fix #32951: Progressive refine crashing Blender when used with multiple cuda
Issue was caused by offline rendering could have been allocated the same tile to different devices and in this case buffers would become invalid. Made it more clear in the code, so now it's flag for tile manager to indicate whether tiles should always be allocated for the same device or not. Also cleaned a way how tile index for progressive refine is calculating, which is now avoids tricky computation based on tile coordinate and it's dimensions.
Diffstat (limited to 'intern/cycles/render/tile.h')
-rw-r--r--intern/cycles/render/tile.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/intern/cycles/render/tile.h b/intern/cycles/render/tile.h
index 587dfbe4f1a..3ccc73deed1 100644
--- a/intern/cycles/render/tile.h
+++ b/intern/cycles/render/tile.h
@@ -30,6 +30,7 @@ CCL_NAMESPACE_BEGIN
class Tile {
public:
+ int index;
int x, y, w, h;
int device;
bool rendering;
@@ -37,8 +38,8 @@ public:
Tile()
{}
- Tile(int x_, int y_, int w_, int h_, int device_)
- : x(x_), y(y_), w(w_), h(h_), device(device_), rendering(false) {}
+ 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) {}
};
/* Tile Manager */
@@ -54,12 +55,11 @@ public:
int resolution_divider;
int num_tiles;
int num_rendered_tiles;
- int tile_w;
- int tile_h;
list<Tile> tiles;
} state;
- TileManager(bool progressive, int num_samples, int2 tile_size, int start_resolution, int num_devices = 1);
+ TileManager(bool progressive, int num_samples, int2 tile_size, int start_resolution,
+ int preserve_tile_device, int num_devices = 1);
~TileManager();
void reset(BufferParams& params, int num_samples);
@@ -77,6 +77,15 @@ protected:
int start_resolution;
int num_devices;
+ /* in some cases it is important that the same tile will be returned for the same
+ * device it was originally generated for (i.e. viewport rendering when buffer is
+ * allocating once for tile and then always used by it)
+ *
+ * in other cases any tile could be handled by any device (i.e. final rendering
+ * without progressive refine)
+ */
+ bool preserve_tile_device;
+
list<Tile>::iterator next_center_tile(int device = 0);
};