Blender  V3.3
integrator/shader_eval.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 
6 #include "device/memory.h"
7 
8 #include "kernel/types.h"
9 
10 #include "util/function.h"
11 
13 
14 class Device;
15 class Progress;
16 
21 };
22 
23 /* ShaderEval class performs shader evaluation for background light and displacement. */
24 class ShaderEval {
25  public:
26  ShaderEval(Device *device, Progress &progress);
27 
28  /* Evaluate shader at points specified by KernelShaderEvalInput and write out
29  * RGBA colors to output. */
30  bool eval(const ShaderEvalType type,
31  const int max_num_inputs,
32  const int num_channels,
33  const function<int(device_vector<KernelShaderEvalInput> &)> &fill_input,
34  const function<void(device_vector<float> &)> &read_output);
35 
36  protected:
37  bool eval_cpu(Device *device,
38  const ShaderEvalType type,
41  const int64_t work_size);
42  bool eval_gpu(Device *device,
43  const ShaderEvalType type,
46  const int64_t work_size);
47 
50 };
51 
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
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)
Definition: shader_eval.cpp:23
ShaderEval(Device *device, Progress &progress)
Definition: shader_eval.cpp:18
bool eval_cpu(Device *device, const ShaderEvalType type, device_vector< KernelShaderEvalInput > &input, device_vector< float > &output, const int64_t work_size)
Definition: shader_eval.cpp:76
Progress & progress_
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
Definition: cuda/compat.h:9
@ SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY
@ SHADER_EVAL_BACKGROUND
@ SHADER_EVAL_DISPLACE
ccl_gpu_kernel_postfix ccl_global const int ccl_global float const int work_size
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_global KernelShaderEvalInput * input
__int64 int64_t
Definition: stdint.h:89