Cycles: Initialize the RNG state from the kernel instead of the host
This allows to save a memory copy, which will be particularly useful for network rendering. Reviewers: sergey, brecht, dingto, juicyfruit, maiself Differential Revision: https://developer.blender.org/D2323
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "util_hash.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
ccl_device_inline void kernel_path_trace_setup(KernelGlobals *kg,
|
||||
@@ -28,6 +30,10 @@ ccl_device_inline void kernel_path_trace_setup(KernelGlobals *kg,
|
||||
|
||||
int num_samples = kernel_data.integrator.aa_samples;
|
||||
|
||||
if(sample == 0) {
|
||||
*rng_state = hash_int_2d(x, y);
|
||||
}
|
||||
|
||||
path_rng_init(kg, rng_state, sample, num_samples, rng, x, y, &filter_u, &filter_v);
|
||||
|
||||
/* sample camera ray */
|
||||
|
Reference in New Issue
Block a user