Blender  V2.93
svm_aov.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 
20  ccl_global float *buffer)
21 {
22  int path_flag = state->flag;
23 
24  bool is_primary = (path_flag & PATH_RAY_CAMERA) && (!(path_flag & PATH_RAY_SINGLE_PASS_DONE));
25 
26  return ((buffer != NULL) && is_primary);
27 }
28 
30  KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, ccl_global float *buffer)
31 {
32  float3 val = stack_load_float3(stack, node.y);
33 
34  if (buffer) {
35  kernel_write_pass_float4(buffer + kernel_data.film.pass_aov_color + 4 * node.z,
36  make_float4(val.x, val.y, val.z, 1.0f));
37  }
38 }
39 
41  KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, ccl_global float *buffer)
42 {
43  float val = stack_load_float(stack, node.y);
44 
45  if (buffer) {
46  kernel_write_pass_float(buffer + kernel_data.film.pass_aov_value + node.z, val);
47  }
48 }
OperationNode * node
CCL_NAMESPACE_BEGIN ccl_device_inline float3 stack_load_float3(float *stack, uint a)
ccl_device_inline float stack_load_float(float *stack, uint a)
#define kernel_data
#define ccl_addr_space
#define ccl_device
#define ccl_device_inline
#define ccl_global
#define CCL_NAMESPACE_END
#define make_float4(x, y, z, w)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
@ PATH_RAY_SINGLE_PASS_DONE
Definition: kernel_types.h:304
@ PATH_RAY_CAMERA
Definition: kernel_types.h:266
ShaderData
ccl_device_inline void kernel_write_pass_float4(ccl_global float *buffer, float4 value)
CCL_NAMESPACE_BEGIN ccl_device_inline void kernel_write_pass_float(ccl_global float *buffer, float value)
static ulong state[N]
float z
Definition: sky_float3.h:35
float y
Definition: sky_float3.h:35
float x
Definition: sky_float3.h:35
ccl_device void svm_node_aov_color(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, ccl_global float *buffer)
Definition: svm_aov.h:29
ccl_device void svm_node_aov_value(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, ccl_global float *buffer)
Definition: svm_aov.h:40
CCL_NAMESPACE_BEGIN ccl_device_inline bool svm_node_aov_check(ccl_addr_space PathState *state, ccl_global float *buffer)
Definition: svm_aov.h:19