forked from bartvdbraak/blender
Fix T43999: MIS for environment broken after multi-threading commit
Typo in task start row calculation.
This commit is contained in:
parent
ce009c8019
commit
60df4d10ff
@ -466,17 +466,19 @@ void LightManager::device_update_background(Device *device, DeviceScene *dscene,
|
|||||||
/* Threaded evaluation for large resolution. */
|
/* Threaded evaluation for large resolution. */
|
||||||
const int num_blocks = TaskScheduler::num_threads();
|
const int num_blocks = TaskScheduler::num_threads();
|
||||||
const int chunk_size = res / num_blocks;
|
const int chunk_size = res / num_blocks;
|
||||||
|
int start_row = 0;
|
||||||
TaskPool pool;
|
TaskPool pool;
|
||||||
for(int i = 0; i < num_blocks; ++i) {
|
for(int i = 0; i < num_blocks; ++i) {
|
||||||
const int current_chunk_size =
|
const int current_chunk_size =
|
||||||
(i != num_blocks - 1) ? chunk_size
|
(i != num_blocks - 1) ? chunk_size
|
||||||
: (res - i * chunk_size);
|
: (res - i * chunk_size);
|
||||||
pool.push(function_bind(&background_cdf,
|
pool.push(function_bind(&background_cdf,
|
||||||
i, i + current_chunk_size,
|
start_row, start_row + current_chunk_size,
|
||||||
res,
|
res,
|
||||||
cdf_count,
|
cdf_count,
|
||||||
&pixels,
|
&pixels,
|
||||||
cond_cdf));
|
cond_cdf));
|
||||||
|
start_row += current_chunk_size;
|
||||||
}
|
}
|
||||||
pool.wait_work();
|
pool.wait_work();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user