diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-18 19:19:01 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-18 20:02:10 +0300 |
commit | a184d0dd023cc0b6fee5e02510addb91d66f8e01 (patch) | |
tree | c21d2a27d104376444b1f009094b31d9a3cb9d97 /intern | |
parent | fc4b1fede385687acb2cf7f82591aa43097110a9 (diff) |
Cleanup: fix outdated comment and use of atomics
This is only used by a single device, not need for thread safety.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/integrator/work_tile_scheduler.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/intern/cycles/integrator/work_tile_scheduler.cpp b/intern/cycles/integrator/work_tile_scheduler.cpp index e6ada2f46ee..234b1fae915 100644 --- a/intern/cycles/integrator/work_tile_scheduler.cpp +++ b/intern/cycles/integrator/work_tile_scheduler.cpp @@ -88,7 +88,7 @@ bool WorkTileScheduler::get_work(KernelWorkTile *work_tile_, const int max_work_ DCHECK_NE(max_num_path_states_, 0); - const int work_index = atomic_fetch_and_add_int32(&next_work_index_, 1); + const int work_index = next_work_index_++; if (work_index >= total_work_size_) { return false; } @@ -121,12 +121,8 @@ bool WorkTileScheduler::get_work(KernelWorkTile *work_tile_, const int max_work_ if (max_work_size && tile_work_size > max_work_size) { /* The work did not fit into the requested limit of the work size. Unschedule the tile, - * allowing others (or ourselves later one) to pick it up. - * - * TODO: Such temporary decrement is not ideal, since it might lead to situation when another - * device sees there is nothing to be done, finishing its work and leaving all work to be - * done by us. */ - atomic_fetch_and_add_int32(&next_work_index_, -1); + * so it can be picked up again later. */ + next_work_index_--; return false; } |