Blender  V2.93
svm_value.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2013 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 /* Value Nodes */
20 
22  KernelGlobals *kg, ShaderData *sd, float *stack, uint ivalue, uint out_offset)
23 {
24  stack_store_float(stack, out_offset, __uint_as_float(ivalue));
25 }
26 
28  KernelGlobals *kg, ShaderData *sd, float *stack, uint out_offset, int *offset)
29 {
30  /* read extra data */
31  uint4 node1 = read_node(kg, offset);
32  float3 p = make_float3(
33  __uint_as_float(node1.y), __uint_as_float(node1.z), __uint_as_float(node1.w));
34 
35  stack_store_float3(stack, out_offset, p);
36 }
37 
unsigned int uint
Definition: BLI_sys_types.h:83
ccl_device_inline uint4 read_node(KernelGlobals *kg, int *offset)
ccl_device_inline void stack_store_float3(float *stack, uint a, float3 f)
ccl_device_inline void stack_store_float(float *stack, uint a, float f)
#define ccl_device
#define CCL_NAMESPACE_END
#define make_float3(x, y, z)
ShaderData
CCL_NAMESPACE_BEGIN ccl_device void svm_node_value_f(KernelGlobals *kg, ShaderData *sd, float *stack, uint ivalue, uint out_offset)
Definition: svm_value.h:21
ccl_device void svm_node_value_v(KernelGlobals *kg, ShaderData *sd, float *stack, uint out_offset, int *offset)
Definition: svm_value.h:27
ccl_device_inline float __uint_as_float(uint i)
Definition: util_math.h:232