Blender  V3.3
mix.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #pragma once
5 
7 
8 /* Node */
9 
12  ccl_private float *stack,
13  uint fac_offset,
14  uint c1_offset,
15  uint c2_offset,
16  int offset)
17 {
18  /* read extra data */
19  uint4 node1 = read_node(kg, &offset);
20 
21  float fac = stack_load_float(stack, fac_offset);
22  float3 c1 = stack_load_float3(stack, c1_offset);
23  float3 c2 = stack_load_float3(stack, c2_offset);
24  float3 result = svm_mix((NodeMix)node1.y, fac, c1, c2);
25 
26  stack_store_float3(stack, node1.z, result);
27  return offset;
28 }
29 
unsigned int uint
Definition: BLI_sys_types.h:67
ccl_device_noinline_cpu float3 svm_mix(NodeMix type, float fac, float3 c1, float3 c2)
Definition: color_util.h:250
#define ccl_private
Definition: cuda/compat.h:48
#define ccl_device_noinline
Definition: cuda/compat.h:40
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
const KernelGlobalsCPU *ccl_restrict KernelGlobals
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_device_inline void stack_store_float3(ccl_private float *stack, uint a, float3 f)
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_inline float stack_load_float(ccl_private float *stack, uint a)
ShaderData
Definition: kernel/types.h:925
CCL_NAMESPACE_BEGIN ccl_device_noinline int svm_node_mix(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint fac_offset, uint c1_offset, uint c2_offset, int offset)
Definition: mix.h:10
uint y
Definition: types_uint4.h:15
uint z
Definition: types_uint4.h:15