diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-02 19:26:47 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-02 19:26:47 +0400 |
commit | ea5e0d0212c982e0b440d19124a991e1d467177e (patch) | |
tree | b515b12849b31b1db19c39b0981d3c7c05fc53ca /source/blender/compositor/intern | |
parent | a0c6371b7f526905bb06e6f099f8b6f8bb743c01 (diff) |
Limit out of screen tiles to be scheduled.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r-- | source/blender/compositor/intern/COM_ExecutionGroup.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 1a0bd95b7d6..2d3d24b296f 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -485,14 +485,18 @@ bool ExecutionGroup::scheduleAreaWhenPossible(ExecutionSystem *graph, rcti *area float chunkSizef = this->m_chunkSize; int indexx, indexy; - const int minxchunk = floor(area->xmin / chunkSizef); - const int maxxchunk = ceil((area->xmax - 1) / chunkSizef); - const int minychunk = floor(area->ymin / chunkSizef); - const int maxychunk = ceil((area->ymax - 1) / chunkSizef); + int minxchunk = floor(area->xmin / chunkSizef); + int maxxchunk = ceil((area->xmax - 1) / chunkSizef); + int minychunk = floor(area->ymin / chunkSizef); + int maxychunk = ceil((area->ymax - 1) / chunkSizef); + minxchunk = MAX2(minxchunk, 0); + minychunk = MAX2(minychunk, 0); + maxxchunk = MIN2(maxxchunk, this->m_numberOfXChunks); + maxychunk = MIN2(maxychunk, this->m_numberOfYChunks); bool result = true; - for (indexx = max(minxchunk, 0); indexx < maxxchunk; indexx++) { - for (indexy = max(minychunk, 0); indexy < maxychunk; indexy++) { + for (indexx = minxchunk; indexx < maxxchunk; indexx++) { + for (indexy = minychunk; indexy < maxychunk; indexy++) { if (!scheduleChunkWhenPossible(graph, indexx, indexy)) { result = false; } |