Cycles: Reduce amount of malloc() calls from the kernel
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 17 May 2016 10:30:46 +0000 (12:30 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 18 May 2016 08:14:24 +0000 (10:14 +0200)
commit7b356a856540a1affa5dc85360183418e6337a5a
tree9acee7019c696f694c97d504e1a2fe678a7f0cd1
parent2433a537fa12dad6cc8a1c323b1b73e5cad6cd4d
Cycles: Reduce amount of malloc() calls from the kernel

This commit makes it so malloc() is only happening once per volume and
once per transparent shadow query (per thread), improving scalability of
the code to multiple CPU cores.

Hard to measure this with a low-bottom i7 here currently, but from quick
tests seems volume sampling gave about 3-5% speedup.

The idea is to store allocated memory in kernel globals, which are per
thread on CPU already.

Reviewers: dingto, juicyfruit, lukasstockner97, maiself, brecht

Reviewed By: brecht

Subscribers: Blendify, nutel

Differential Revision: https://developer.blender.org/D1996
intern/cycles/device/device_cpu.cpp
intern/cycles/kernel/kernel_globals.h
intern/cycles/kernel/kernel_shadow.h
intern/cycles/kernel/kernel_volume.h