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-11-05 12:05:14 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-11-05 12:05:14 +0400
commit759ea4078782ace683a3e835166b7f324c8e3224 (patch)
tree80b50138b42f89a247612c9461d467391014683d /intern/cycles/render/tile.cpp
parent6eec49ed20fb3a8032718d5f4b9a3e774098df3f (diff)
Render engines: replace number of x/y tiles with tile size
Now tile size is setting up explicitly instead of using number of tiles. This allows better control over GPU performance, where having tiles aligned to specific size makes lots of sense. Still to come: need to update startup.blend to make tiles size 64x64.
Diffstat (limited to 'intern/cycles/render/tile.cpp')
-rw-r--r--intern/cycles/render/tile.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/intern/cycles/render/tile.cpp b/intern/cycles/render/tile.cpp
index c294239bac0..74585dd5058 100644
--- a/intern/cycles/render/tile.cpp
+++ b/intern/cycles/render/tile.cpp
@@ -84,8 +84,6 @@ void TileManager::gen_tiles_global()
int tile_w = (tile_size.x >= image_w)? 1: (image_w + tile_size.x - 1)/tile_size.x;
int tile_h = (tile_size.y >= image_h)? 1: (image_h + tile_size.y - 1)/tile_size.y;
- int sub_w = (image_w + tile_w - 1)/tile_w;
- int sub_h = (image_h + tile_h - 1)/tile_h;
int num_logical_devices = preserve_tile_device? num_devices: 1;
int num = min(image_h, num_logical_devices);
@@ -96,10 +94,10 @@ void TileManager::gen_tiles_global()
for(int tile_y = 0; tile_y < tile_h; tile_y++) {
for(int tile_x = 0; tile_x < tile_w; tile_x++, tile_index++) {
- int x = tile_x * sub_w;
- int y = tile_y * sub_h;
- int w = (tile_x == tile_w-1)? image_w - x: sub_w;
- int h = (tile_y == tile_h-1)? image_h - y: sub_h;
+ int x = tile_x * tile_size.x;
+ int y = tile_y * tile_size.y;
+ int w = (tile_x == tile_w-1)? image_w - x: tile_size.x;
+ int h = (tile_y == tile_h-1)? image_h - y: tile_size.y;
state.tiles.push_back(Tile(tile_index, x, y, w, h, cur_device));
cur_tiles++;
@@ -131,15 +129,13 @@ void TileManager::gen_tiles_sliced()
int tile_w = (tile_size.x >= image_w)? 1: (image_w + tile_size.x - 1)/tile_size.x;
int tile_h = (tile_size.y >= device_h)? 1: (device_h + tile_size.y - 1)/tile_size.y;
- int sub_w = (image_w + tile_w - 1)/tile_w;
- int sub_h = (device_h + tile_h - 1)/tile_h;
for(int tile_y = 0; tile_y < tile_h; tile_y++) {
for(int tile_x = 0; tile_x < tile_w; tile_x++, tile_index++) {
- int x = tile_x * sub_w;
- int y = tile_y * sub_h;
- int w = (tile_x == tile_w-1)? image_w - x: sub_w;
- int h = (tile_y == tile_h-1)? device_h - y: sub_h;
+ int x = tile_x * tile_size.x;
+ int y = tile_y * tile_size.y;
+ int w = (tile_x == tile_w-1)? image_w - x: tile_size.x;
+ int h = (tile_y == tile_h-1)? device_h - y: tile_size.x;
state.tiles.push_back(Tile(tile_index, x, y + device_y, w, h, device));
}