Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2017-09-27 04:53:03 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-10-04 22:11:14 +0300
commit5bb677e592fd5902600f41653a2d56b4d9ae8c56 (patch)
tree0b03c1e67ec400df23e7ec45ca7e0cc63c1c5ddd /intern/cycles/kernel/split
parent12f453820514e9478afdda0acf4c4fb1eac11e1c (diff)
Code refactor: zero render buffers outside of kernel.
This was originally done with the first sample in the kernel for better performance, but it doesn't work anymore with atomics. Any benefit was very minor anyway, too small to measure it seems.
Diffstat (limited to 'intern/cycles/kernel/split')
-rw-r--r--intern/cycles/kernel/split/kernel_buffer_update.h6
-rw-r--r--intern/cycles/kernel/split/kernel_data_init.h41
-rw-r--r--intern/cycles/kernel/split/kernel_path_init.h5
3 files changed, 0 insertions, 52 deletions
diff --git a/intern/cycles/kernel/split/kernel_buffer_update.h b/intern/cycles/kernel/split/kernel_buffer_update.h
index 5e9db821f7b..511334e0550 100644
--- a/intern/cycles/kernel/split/kernel_buffer_update.h
+++ b/intern/cycles/kernel/split/kernel_buffer_update.h
@@ -110,7 +110,6 @@ ccl_device void kernel_buffer_update(KernelGlobals *kg,
/* Store buffer offset for writing to passes. */
uint buffer_offset = (tile->offset + x + y*tile->stride) * kernel_data.film.pass_stride;
- ccl_global float *buffer = tile->buffer + buffer_offset;
kernel_split_state.buffer_offset[ray_index] = buffer_offset;
/* Initialize random numbers and ray. */
@@ -131,11 +130,6 @@ ccl_device void kernel_buffer_update(KernelGlobals *kg,
enqueue_flag = 1;
}
else {
- /* These rays do not participate in path-iteration. */
- float4 L_rad = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
- /* Accumulate result in output buffer. */
- kernel_write_pass_float4(buffer, sample, L_rad);
-
ASSIGN_RAY_STATE(ray_state, ray_index, RAY_TO_REGENERATE);
}
}
diff --git a/intern/cycles/kernel/split/kernel_data_init.h b/intern/cycles/kernel/split/kernel_data_init.h
index f4df949fdb1..77fb61b80a8 100644
--- a/intern/cycles/kernel/split/kernel_data_init.h
+++ b/intern/cycles/kernel/split/kernel_data_init.h
@@ -23,22 +23,6 @@ CCL_NAMESPACE_BEGIN
* The number of elements in the queues is initialized to 0;
*/
-/* Distributes an amount of work across all threads
- * note: work done inside the loop may not show up to all threads till after
- * the current kernel has completed
- */
-#define parallel_for(kg, iter_name, work_size) \
- for(size_t _size = (work_size), \
- _global_size = ccl_global_size(0) * ccl_global_size(1), \
- _n = _size / _global_size, \
- _thread = ccl_global_id(0) + ccl_global_id(1) * ccl_global_size(0), \
- iter_name = (_n > 0) ? (_thread * _n) : (_thread) \
- ; \
- (iter_name < (_thread+1) * _n) || (iter_name == _n * _global_size + _thread && _thread < _size % _global_size) \
- ; \
- iter_name = (iter_name != (_thread+1) * _n - 1) ? (iter_name + 1) : (_n * _global_size + _thread) \
- )
-
#ifndef __KERNEL_CPU__
ccl_device void kernel_data_init(
#else
@@ -119,31 +103,6 @@ void KERNEL_FUNCTION_FULL_NAME(data_init)(
*/
*use_queues_flag = 0;
}
-
- /* zero the tiles pixels if this is the first sample */
- if(start_sample == 0) {
- int pass_stride = kernel_data.film.pass_stride;
-
-#ifdef __KERNEL_CPU__
- for(int y = sy; y < sy + sh; y++) {
- int index = offset + y * stride;
- memset(buffer + (sx + index) * pass_stride, 0, sizeof(float) * pass_stride * sw);
- }
-#else
- parallel_for(kg, i, sw * sh * pass_stride) {
- int pixel = i / pass_stride;
- int pass = i % pass_stride;
-
- int x = sx + pixel % sw;
- int y = sy + pixel / sw;
-
- int index = (offset + x + y*stride) * pass_stride + pass;
-
- *(buffer + index) = 0.0f;
- }
-#endif
- }
-
#endif /* KERENL_STUB */
}
diff --git a/intern/cycles/kernel/split/kernel_path_init.h b/intern/cycles/kernel/split/kernel_path_init.h
index 1bd641b031d..5ad62b585fe 100644
--- a/intern/cycles/kernel/split/kernel_path_init.h
+++ b/intern/cycles/kernel/split/kernel_path_init.h
@@ -47,7 +47,6 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
/* Store buffer offset for writing to passes. */
uint buffer_offset = (tile->offset + x + y*tile->stride) * kernel_data.film.pass_stride;
- ccl_global float *buffer = tile->buffer + buffer_offset;
kernel_split_state.buffer_offset[ray_index] = buffer_offset;
/* Initialize random numbers and ray. */
@@ -75,10 +74,6 @@ ccl_device void kernel_path_init(KernelGlobals *kg) {
#endif
}
else {
- /* These rays do not participate in path-iteration. */
- float4 L_rad = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
- /* Accumulate result in output buffer. */
- kernel_write_pass_float4(buffer, sample, L_rad);
ASSIGN_RAY_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE);
}
}