18 KernelGlobals kg,
int offset,
float f,
bool interpolate,
bool extrapolate,
int table_size)
20 if ((f < 0.0f || f > 1.0f) && extrapolate) {
32 return t0 + dy * f * (table_size - 1);
39 float t = f - (
float)i;
43 if (interpolate && t > 0.0f)
44 a = (1.0f - t) * a + t *
fetch_float(kg, offset + i + 1);
50 KernelGlobals kg,
int offset,
float f,
bool interpolate,
bool extrapolate,
int table_size)
52 if ((f < 0.0f || f > 1.0f) && extrapolate) {
64 return t0 + dy * f * (table_size - 1);
71 float t = f - (
float)i;
75 if (interpolate && t > 0.0f)
84 uint fac_offset, color_offset, alpha_offset;
85 uint interpolate = node.z;
92 float4 color =
rgb_ramp_lookup(kg, offset, fac, interpolate,
false, table_size);
106 uint fac_offset, color_offset, out_offset, extrapolate;
115 const float range_x = max_x - min_x;
118 float r =
rgb_ramp_lookup(kg, offset, relpos.
x,
true, extrapolate, table_size).
x;
119 float g =
rgb_ramp_lookup(kg, offset, relpos.
y,
true, extrapolate, table_size).y;
120 float b =
rgb_ramp_lookup(kg, offset, relpos.
z,
true, extrapolate, table_size).z;
122 color = (1.0f - fac) * color + fac *
make_float3(r, g,
b);
125 offset += table_size;
132 uint fac_offset, value_in_offset, out_offset, extrapolate;
141 const float range = max -
min;
142 const float relpos = (in -
min) / range;
146 in = (1.0f - fac) * in + fac *
v;
149 offset += table_size;
ATTR_WARN_UNUSED_RESULT const BMVert * v
local_group_size(16, 16) .push_constant(Type b
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define kernel_data_fetch(name, index)
#define ccl_device_inline
#define ccl_device_noinline
#define CCL_NAMESPACE_END
draw_view in_light_buf[] float
ccl_device_inline void stack_store_float3(ccl_private float *stack, uint a, float3 f)
ccl_device_inline float4 fetch_node_float(KernelGlobals kg, int offset)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 stack_load_float3(ccl_private float *stack, uint a)
ccl_device_inline uint4 read_node(KernelGlobals kg, ccl_private int *offset)
ccl_device_forceinline void svm_unpack_node_uchar3(uint i, ccl_private uint *x, ccl_private uint *y, ccl_private uint *z)
ccl_device_inline void stack_store_float(ccl_private float *stack, uint a, float f)
ccl_device_inline float stack_load_float(ccl_private float *stack, uint a)
ccl_device_forceinline void svm_unpack_node_uchar4(uint i, ccl_private uint *x, ccl_private uint *y, ccl_private uint *z, ccl_private uint *w)
ccl_device_inline bool stack_valid(uint a)
ccl_device_inline float float_ramp_lookup(KernelGlobals kg, int offset, float f, bool interpolate, bool extrapolate, int table_size)
ccl_device_inline float4 rgb_ramp_lookup(KernelGlobals kg, int offset, float f, bool interpolate, bool extrapolate, int table_size)
CCL_NAMESPACE_BEGIN ccl_device_inline float fetch_float(KernelGlobals kg, int offset)
ccl_device_noinline int svm_node_rgb_ramp(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint4 node, int offset)
ccl_device_noinline int svm_node_curves(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint4 node, int offset)
ccl_device_noinline int svm_node_curve(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint4 node, int offset)
ccl_device_inline int float_to_int(float f)
ccl_device_inline float3 float4_to_float3(const float4 a)
ccl_device_inline int clamp(int a, int mn, int mx)