Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/tile.cpp
| Context not available. | |||||
| #include "tile.h" | #include "tile.h" | ||||
| #include "util_algorithm.h" | #include "util_algorithm.h" | ||||
| #include "util_hilbert.h" | |||||
| #include "util_types.h" | #include "util_types.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
sergey: Can it be more meaningful name than just a single letter? Same applies to the cases below. | |||||
Not Done Inline ActionsBraces around the block. sergey: Braces around the block. | |||||
Not Done Inline ActionsThis will fail for viewport renders, i.e. sergey: This will fail for viewport renders, i.e. | |||||
Not Done Inline Actionsd >> 1 sergey: `d >> 1` | |||||
Not Done Inline Actionsd >>= 2 sergey: `d >>= 2` | |||||
Not Done Inline ActionsCan we have more readable names for the direction? Like, enum {
DIRECTION_LEFT,
DIRECTION_TOP,
};or something similar? sergey: Can we have more readable names for the direction? Like,
enum {
DIRECTION_LEFT… | |||||
Not Done Inline ActionsBraces. sergey: Braces. | |||||
| Context not available. | |||||
| int64_t cordx = max(1, params.width/resolution); | int64_t cordx = max(1, params.width/resolution); | ||||
| int64_t cordy = max(1, params.height/resolution); | int64_t cordy = max(1, params.height/resolution); | ||||
| int64_t mindist = INT_MAX; | int64_t mindist = INT_MAX; | ||||
| int64_t centx = cordx / 2, centy = cordy / 2; | int64_t centx = cordx / 2, centy = cordy / 2; | ||||
Not Done Inline ActionsThis is to be calculated for only TILE_HILBERT it seems, no need to calculate it for all the tile orders. sergey: This is to be calculated for only `TILE_HILBERT` it seems, no need to calculate it for all the… | |||||
| int64_t hilbert_n; | |||||
| if(tile_order == TILE_HILBERT) { | |||||
| hilbert_n = hilbert_roundpow2(max((params.width + tile_size.x - 1) / tile_size.x, (params.height + tile_size.y - 1) / tile_size.y)); | |||||
sergeyUnsubmitted Not Done Inline ActionsCould also become an util_ function. sergey: Could also become an util_ function. | |||||
| } | |||||
| for(iter = state.tiles.begin(); iter != state.tiles.end(); iter++) { | for(iter = state.tiles.begin(); iter != state.tiles.end(); iter++) { | ||||
| if(iter->device == logical_device && iter->rendering == false) { | if(iter->device == logical_device && iter->rendering == false) { | ||||
| Tile &cur_tile = *iter; | Tile &cur_tile = *iter; | ||||
Not Done Inline ActionsThis doesn't follow code style. sergey: This doesn't follow code style. | |||||
Not Done Inline ActionsPicky: Prefer not to have quesitons in comments, statements are usually cleaner to follow. Like, "Check whether center of spiral was reached.". Applies to few places here. sergey: Picky: Prefer not to have quesitons in comments, statements are usually cleaner to follow. Like… | |||||
| Context not available. | |||||
| case TILE_BOTTOM_TO_TOP: | case TILE_BOTTOM_TO_TOP: | ||||
| distx = cordx + cur_tile.y; | distx = cordx + cur_tile.y; | ||||
| break; | break; | ||||
| case TILE_HILBERT: | |||||
| distx = hilbert_xy2d(hilbert_n, cur_tile.x / tile_size.x, cur_tile.y / tile_size.y); | |||||
| break; | |||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| Context not available. | |||||
Not Done Inline ActionsPlease apply this separately. Can go to master now, but please always use mustage (curly ;) brackets. sergey: Please apply this separately. Can go to master now, but please always use mustage (curly ;)… | |||||
Can it be more meaningful name than just a single letter? Same applies to the cases below.