diff options
author | Jeroen Bakker <jbakker> | 2021-06-11 16:55:09 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-06-11 16:55:22 +0300 |
commit | 7b30a3e98def6f9f158da0e315b7077655acfd20 (patch) | |
tree | 0299bf5e27e36e9f6c9b26ce8d2beb4452a95463 /source/blender/imbuf/intern/divers.c | |
parent | 7b76a160a4647b17c1a55da4bd40e8f549225568 (diff) |
Performance: Use parallel range for ImBuf scanline processor.
Scanline processor did its own heurestic what didn't scale well when
having a multiple cores. In stead of using our own code this patch will
leave it to TBB to determine how to split the scanlines over the
available threads.
Performance of the IMB_transform before this change was 0.002123s, with
this change 0.001601s. This change increases performance in other areas
as well including color management conversions.
Reviewed By: zeddb
Differential Revision: https://developer.blender.org/D11578
Diffstat (limited to 'source/blender/imbuf/intern/divers.c')
-rw-r--r-- | source/blender/imbuf/intern/divers.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 5f580449e12..47712456014 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -536,13 +536,12 @@ typedef struct FloatToFloatThreadData { int stride_from; } FloatToFloatThreadData; -static void imb_buffer_float_from_float_thread_do(void *data_v, - int start_scanline, - int num_scanlines) +static void imb_buffer_float_from_float_thread_do(void *data_v, int scanline) { + const int num_scanlines = 1; FloatToFloatThreadData *data = (FloatToFloatThreadData *)data_v; - size_t offset_from = ((size_t)start_scanline) * data->stride_from * data->channels_from; - size_t offset_to = ((size_t)start_scanline) * data->stride_to * data->channels_from; + size_t offset_from = ((size_t)scanline) * data->stride_from * data->channels_from; + size_t offset_to = ((size_t)scanline) * data->stride_to * data->channels_from; IMB_buffer_float_from_float(data->rect_to + offset_to, data->rect_from + offset_from, data->channels_from, |