Blender  V2.93
Functions
kernel_random.h File Reference
#include "kernel/kernel_jitter.h"
#include "util/util_hash.h"

Go to the source code of this file.

Functions

CCL_NAMESPACE_BEGIN ccl_device_forceinline float path_rng_1D (KernelGlobals *kg, uint rng_hash, int sample, int num_samples, int dimension)
 
ccl_device_forceinline void path_rng_2D (KernelGlobals *kg, uint rng_hash, int sample, int num_samples, int dimension, float *fx, float *fy)
 
ccl_device_inline void path_rng_init (KernelGlobals *kg, int sample, int num_samples, uint *rng_hash, int x, int y, float *fx, float *fy)
 
ccl_device uint lcg_step_uint (uint *rng)
 
ccl_device float lcg_step_float (uint *rng)
 
ccl_device uint lcg_init (uint seed)
 
ccl_device_inline float path_state_rng_1D (KernelGlobals *kg, const ccl_addr_space PathState *state, int dimension)
 
ccl_device_inline void path_state_rng_2D (KernelGlobals *kg, const ccl_addr_space PathState *state, int dimension, float *fx, float *fy)
 
ccl_device_inline float path_state_rng_1D_hash (KernelGlobals *kg, const ccl_addr_space PathState *state, uint hash)
 
ccl_device_inline float path_branched_rng_1D (KernelGlobals *kg, uint rng_hash, const ccl_addr_space PathState *state, int branch, int num_branches, int dimension)
 
ccl_device_inline void path_branched_rng_2D (KernelGlobals *kg, uint rng_hash, const ccl_addr_space PathState *state, int branch, int num_branches, int dimension, float *fx, float *fy)
 
ccl_device_inline float path_state_rng_light_termination (KernelGlobals *kg, const ccl_addr_space PathState *state)
 
ccl_device_inline float path_branched_rng_light_termination (KernelGlobals *kg, uint rng_hash, const ccl_addr_space PathState *state, int branch, int num_branches)
 
ccl_device_inline uint lcg_state_init (PathState *state, uint scramble)
 
ccl_device_inline uint lcg_state_init_addrspace (ccl_addr_space PathState *state, uint scramble)
 
ccl_device float lcg_step_float_addrspace (ccl_addr_space uint *rng)
 
ccl_device_inline bool sample_is_even (int pattern, int sample)
 

Function Documentation

◆ lcg_init()

ccl_device uint lcg_init ( uint  seed)

Definition at line 171 of file kernel_random.h.

References lcg_step_uint(), and seed.

Referenced by lcg_state_init(), and lcg_state_init_addrspace().

◆ lcg_state_init()

ccl_device_inline uint lcg_state_init ( PathState state,
uint  scramble 
)

Definition at line 277 of file kernel_random.h.

References lcg_init(), and state.

◆ lcg_state_init_addrspace()

ccl_device_inline uint lcg_state_init_addrspace ( ccl_addr_space PathState state,
uint  scramble 
)

Definition at line 282 of file kernel_random.h.

References lcg_init(), and state.

Referenced by shader_eval_surface().

◆ lcg_step_float()

ccl_device float lcg_step_float ( uint rng)

Definition at line 164 of file kernel_random.h.

References float().

◆ lcg_step_float_addrspace()

ccl_device float lcg_step_float_addrspace ( ccl_addr_space uint rng)

Definition at line 287 of file kernel_random.h.

References float().

Referenced by bsdf_principled_hair_sample(), mf_eval(), and mf_sample().

◆ lcg_step_uint()

ccl_device uint lcg_step_uint ( uint rng)

Definition at line 157 of file kernel_random.h.

Referenced by lcg_init().

◆ path_branched_rng_1D()

ccl_device_inline float path_branched_rng_1D ( KernelGlobals *  kg,
uint  rng_hash,
const ccl_addr_space PathState state,
int  branch,
int  num_branches,
int  dimension 
)

Definition at line 221 of file kernel_random.h.

References kg, path_rng_1D(), and state.

Referenced by path_branched_rng_light_termination().

◆ path_branched_rng_2D()

ccl_device_inline void path_branched_rng_2D ( KernelGlobals *  kg,
uint  rng_hash,
const ccl_addr_space PathState state,
int  branch,
int  num_branches,
int  dimension,
float fx,
float fy 
)

Definition at line 235 of file kernel_random.h.

References kg, path_rng_2D(), and state.

◆ path_branched_rng_light_termination()

ccl_device_inline float path_branched_rng_light_termination ( KernelGlobals *  kg,
uint  rng_hash,
const ccl_addr_space PathState state,
int  branch,
int  num_branches 
)

Definition at line 265 of file kernel_random.h.

References kernel_data, kg, path_branched_rng_1D(), PRNG_LIGHT_TERMINATE, and state.

◆ path_rng_1D()

CCL_NAMESPACE_BEGIN ccl_device_forceinline float path_rng_1D ( KernelGlobals *  kg,
uint  rng_hash,
int  sample,
int  num_samples,
int  dimension 
)

◆ path_rng_2D()

ccl_device_forceinline void path_rng_2D ( KernelGlobals *  kg,
uint  rng_hash,
int  sample,
int  num_samples,
int  dimension,
float fx,
float fy 
)

◆ path_rng_init()

ccl_device_inline void path_rng_init ( KernelGlobals *  kg,
int  sample,
int  num_samples,
uint rng_hash,
int  x,
int  y,
float fx,
float fy 
)

◆ path_state_rng_1D()

ccl_device_inline float path_state_rng_1D ( KernelGlobals *  kg,
const ccl_addr_space PathState state,
int  dimension 
)

◆ path_state_rng_1D_hash()

ccl_device_inline float path_state_rng_1D_hash ( KernelGlobals *  kg,
const ccl_addr_space PathState state,
uint  hash 
)

Definition at line 207 of file kernel_random.h.

References cmj_hash_simple(), hash, kg, path_rng_1D(), and state.

◆ path_state_rng_2D()

ccl_device_inline void path_state_rng_2D ( KernelGlobals *  kg,
const ccl_addr_space PathState state,
int  dimension,
float fx,
float fy 
)

◆ path_state_rng_light_termination()

ccl_device_inline float path_state_rng_light_termination ( KernelGlobals *  kg,
const ccl_addr_space PathState state 
)

◆ sample_is_even()

ccl_device_inline bool sample_is_even ( int  pattern,
int  sample 
)

Definition at line 294 of file kernel_random.h.

References blender::compositor::sample(), and SAMPLING_PATTERN_PMJ.

Referenced by kernel_write_result().