Blender V4.3
shader_eval.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 "device/memory.h"
8
9#include "kernel/types.h"
10
11#include "util/function.h"
12
14
15class Device;
16class Progress;
17
23
24/* ShaderEval class performs shader evaluation for background light and displacement. */
26 public:
27 ShaderEval(Device *device, Progress &progress);
28
29 /* Evaluate shader at points specified by KernelShaderEvalInput and write out
30 * RGBA colors to output. */
31 bool eval(const ShaderEvalType type,
32 const int max_num_inputs,
33 const int num_channels,
34 const function<int(device_vector<KernelShaderEvalInput> &)> &fill_input,
35 const function<void(device_vector<float> &)> &read_output);
36
37 protected:
38 bool eval_cpu(Device *device,
39 const ShaderEvalType type,
42 const int64_t work_size);
43 bool eval_gpu(Device *device,
44 const ShaderEvalType type,
47 const int64_t work_size);
48
51};
52
bool eval(const ShaderEvalType type, const int max_num_inputs, const int num_channels, const function< int(device_vector< KernelShaderEvalInput > &)> &fill_input, const function< void(device_vector< float > &)> &read_output)
ShaderEval(Device *device, Progress &progress)
bool eval_cpu(Device *device, const ShaderEvalType type, device_vector< KernelShaderEvalInput > &input, device_vector< float > &output, const int64_t work_size)
Progress & progress_
Definition shader_eval.h:50
Device * device_
Definition shader_eval.h:49
bool eval_gpu(Device *device, const ShaderEvalType type, device_vector< KernelShaderEvalInput > &input, device_vector< float > &output, const int64_t work_size)
#define CCL_NAMESPACE_END
ccl_gpu_kernel_postfix ccl_global const int ccl_global float const int work_size
ShaderEvalType
Definition shader_eval.h:18
@ SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY
Definition shader_eval.h:21
@ SHADER_EVAL_BACKGROUND
Definition shader_eval.h:20
@ SHADER_EVAL_DISPLACE
Definition shader_eval.h:19
__int64 int64_t
Definition stdint.h:89