diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-05 12:05:14 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-05 12:05:14 +0400 |
commit | 759ea4078782ace683a3e835166b7f324c8e3224 (patch) | |
tree | 80b50138b42f89a247612c9461d467391014683d /intern | |
parent | 6eec49ed20fb3a8032718d5f4b9a3e774098df3f (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')
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 6 | ||||
-rw-r--r-- | intern/cycles/render/tile.cpp | 20 |
2 files changed, 11 insertions, 15 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 52d2c6a2d89..9cc58e65bef 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -193,10 +193,10 @@ class CyclesRender_PT_performance(CyclesButtonsPanel, Panel): sub.prop(rd, "threads") sub = col.column(align=True) - sub.label(text="Tiles:") + sub.label(text="Tile Size:") - sub.prop(rd, "parts_x", text="X") - sub.prop(rd, "parts_y", text="Y") + sub.prop(rd, "tile_x", text="X") + sub.prop(rd, "tile_y", text="Y") sub.prop(cscene, "use_progressive_refine") 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)); } |