Blender V4.5
value.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#include "kernel/svm/util.h"
8
10
11/* Value Nodes */
12
14 ccl_private ShaderData *sd,
15 ccl_private float *stack,
16 const uint ivalue,
17 const uint out_offset)
18{
19 stack_store_float(stack, out_offset, __uint_as_float(ivalue));
20}
21
23 ccl_private ShaderData *sd,
24 ccl_private float *stack,
25 const uint out_offset,
26 int offset)
27{
28 /* read extra data */
29 const uint4 node1 = read_node(kg, &offset);
30 const float3 p = make_float3(
31 __uint_as_float(node1.y), __uint_as_float(node1.z), __uint_as_float(node1.w));
32
33 stack_store_float3(stack, out_offset, p);
34 return offset;
35}
36
unsigned int uint
ccl_device_inline void stack_store_float(ccl_private float *stack, const uint a, const float f)
ccl_device_inline uint4 read_node(KernelGlobals kg, ccl_private int *const offset)
ccl_device_inline void stack_store_float3(ccl_private float *stack, const uint a, const float3 f)
#define ccl_device
#define ccl_private
const ThreadKernelGlobalsCPU * KernelGlobals
#define CCL_NAMESPACE_END
ccl_device_forceinline float3 make_float3(const float x, const float y, const float z)
#define __uint_as_float(x)
uint y
Definition types_uint4.h:13
uint z
Definition types_uint4.h:13
uint w
Definition types_uint4.h:13
CCL_NAMESPACE_BEGIN ccl_device void svm_node_value_f(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, const uint ivalue, const uint out_offset)
Definition value.h:13
ccl_device int svm_node_value_v(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, const uint out_offset, int offset)
Definition value.h:22