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:
authorStefan Werner <stefan.werner@tangent-animation.com>2019-03-14 13:47:27 +0300
committerStefan Werner <stefan.werner@tangent-animation.com>2019-03-14 13:47:27 +0300
commitd8f1b18d9b7494070715dd7a74e0c7753a43a3aa (patch)
tree3b0868ff1620c57602aafe54f11adf1d769e7981 /intern/cycles/kernel
parentbcc66136c2745b9d047fc5540c7b6b247855955f (diff)
parent47da8dcbcad4ccc5349bc303394e1d01d1c822c5 (diff)
Merge branch 'blender2.7' of git.blender.org:blender
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/kernel_work_stealing.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_work_stealing.h b/intern/cycles/kernel/kernel_work_stealing.h
index 0c2d9379b63..9667156eaf5 100644
--- a/intern/cycles/kernel/kernel_work_stealing.h
+++ b/intern/cycles/kernel/kernel_work_stealing.h
@@ -66,9 +66,15 @@ ccl_device_inline void get_work_pixel(ccl_global const WorkTile *tile,
ccl_private uint *y,
ccl_private uint *sample)
{
+#ifdef __KERNEL_CUDA__
+ /* Keeping threads for the same pixel together improves performance on CUDA. */
+ uint sample_offset = global_work_index % tile->num_samples;
+ uint pixel_offset = global_work_index / tile->num_samples;
+#else /* __KERNEL_CUDA__ */
uint tile_pixels = tile->w * tile->h;
uint sample_offset = global_work_index / tile_pixels;
uint pixel_offset = global_work_index - sample_offset * tile_pixels;
+#endif /* __KERNEL_CUDA__ */
uint y_offset = pixel_offset / tile->w;
uint x_offset = pixel_offset - y_offset * tile->w;