Blender  V3.3
COM_BokehBlurOperation.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
6 
7 #include "COM_OpenCLDevice.h"
8 
9 namespace blender::compositor {
10 
11 constexpr int IMAGE_INPUT_INDEX = 0;
12 constexpr int BOKEH_INPUT_INDEX = 1;
13 constexpr int BOUNDING_BOX_INPUT_INDEX = 2;
14 constexpr int SIZE_INPUT_INDEX = 3;
15 
17 {
23 
24  flags_.complex = true;
25  flags_.open_cl = true;
26 
27  size_ = 1.0f;
28  sizeavailable_ = false;
29  input_program_ = nullptr;
30  input_bokeh_program_ = nullptr;
31  input_bounding_box_reader_ = nullptr;
32 
33  extend_bounds_ = false;
34 }
35 
37 {
39  update_size();
40  }
41 
43  const int width = bokeh->get_width();
44  const int height = bokeh->get_height();
45 
46  const float dimension = MIN2(width, height);
47 
48  bokeh_mid_x_ = width / 2.0f;
49  bokeh_mid_y_ = height / 2.0f;
50  bokehDimension_ = dimension / 2.0f;
51 }
52 
54 {
55  lock_mutex();
56  if (!sizeavailable_) {
57  update_size();
58  }
59  void *buffer = get_input_operation(0)->initialize_tile_data(nullptr);
60  unlock_mutex();
61  return buffer;
62 }
63 
65 {
66  init_mutex();
67 
68  input_program_ = get_input_socket_reader(0);
69  input_bokeh_program_ = get_input_socket_reader(1);
70  input_bounding_box_reader_ = get_input_socket_reader(2);
71 
73 }
74 
75 void BokehBlurOperation::execute_pixel(float output[4], int x, int y, void *data)
76 {
77  float color_accum[4];
78  float temp_bounding_box[4];
79  float bokeh[4];
80 
81  input_bounding_box_reader_->read_sampled(temp_bounding_box, x, y, PixelSampler::Nearest);
82  if (temp_bounding_box[0] > 0.0f) {
83  float multiplier_accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
84  MemoryBuffer *input_buffer = (MemoryBuffer *)data;
85  const rcti &input_rect = input_buffer->get_rect();
86  float *buffer = input_buffer->get_buffer();
87  int bufferwidth = input_buffer->get_width();
88  int bufferstartx = input_rect.xmin;
89  int bufferstarty = input_rect.ymin;
90  const float max_dim = MAX2(this->get_width(), this->get_height());
91  int pixel_size = size_ * max_dim / 100.0f;
92  zero_v4(color_accum);
93 
94  if (pixel_size < 2) {
95  input_program_->read_sampled(color_accum, x, y, PixelSampler::Nearest);
96  multiplier_accum[0] = 1.0f;
97  multiplier_accum[1] = 1.0f;
98  multiplier_accum[2] = 1.0f;
99  multiplier_accum[3] = 1.0f;
100  }
101  int miny = y - pixel_size;
102  int maxy = y + pixel_size;
103  int minx = x - pixel_size;
104  int maxx = x + pixel_size;
105  miny = MAX2(miny, input_rect.ymin);
106  minx = MAX2(minx, input_rect.xmin);
107  maxy = MIN2(maxy, input_rect.ymax);
108  maxx = MIN2(maxx, input_rect.xmax);
109 
110  int step = get_step();
111  int offsetadd = get_offset_add() * COM_DATA_TYPE_COLOR_CHANNELS;
112 
113  float m = bokehDimension_ / pixel_size;
114  for (int ny = miny; ny < maxy; ny += step) {
115  int bufferindex = ((minx - bufferstartx) * COM_DATA_TYPE_COLOR_CHANNELS) +
116  ((ny - bufferstarty) * COM_DATA_TYPE_COLOR_CHANNELS * bufferwidth);
117  for (int nx = minx; nx < maxx; nx += step) {
118  float u = bokeh_mid_x_ - (nx - x) * m;
119  float v = bokeh_mid_y_ - (ny - y) * m;
120  input_bokeh_program_->read_sampled(bokeh, u, v, PixelSampler::Nearest);
121  madd_v4_v4v4(color_accum, bokeh, &buffer[bufferindex]);
122  add_v4_v4(multiplier_accum, bokeh);
123  bufferindex += offsetadd;
124  }
125  }
126  output[0] = color_accum[0] * (1.0f / multiplier_accum[0]);
127  output[1] = color_accum[1] * (1.0f / multiplier_accum[1]);
128  output[2] = color_accum[2] * (1.0f / multiplier_accum[2]);
129  output[3] = color_accum[3] * (1.0f / multiplier_accum[3]);
130  }
131  else {
132  input_program_->read_sampled(output, x, y, PixelSampler::Nearest);
133  }
134 }
135 
137 {
138  deinit_mutex();
139  input_program_ = nullptr;
140  input_bokeh_program_ = nullptr;
141  input_bounding_box_reader_ = nullptr;
142 }
143 
145  ReadBufferOperation *read_operation,
146  rcti *output)
147 {
148  rcti new_input;
149  rcti bokeh_input;
150  const float max_dim = MAX2(this->get_width(), this->get_height());
151 
152  if (sizeavailable_) {
153  new_input.xmax = input->xmax + (size_ * max_dim / 100.0f);
154  new_input.xmin = input->xmin - (size_ * max_dim / 100.0f);
155  new_input.ymax = input->ymax + (size_ * max_dim / 100.0f);
156  new_input.ymin = input->ymin - (size_ * max_dim / 100.0f);
157  }
158  else {
159  new_input.xmax = input->xmax + (10.0f * max_dim / 100.0f);
160  new_input.xmin = input->xmin - (10.0f * max_dim / 100.0f);
161  new_input.ymax = input->ymax + (10.0f * max_dim / 100.0f);
162  new_input.ymin = input->ymin - (10.0f * max_dim / 100.0f);
163  }
164 
165  NodeOperation *operation = get_input_operation(1);
166  bokeh_input.xmax = operation->get_width();
167  bokeh_input.xmin = 0;
168  bokeh_input.ymax = operation->get_height();
169  bokeh_input.ymin = 0;
170  if (operation->determine_depending_area_of_interest(&bokeh_input, read_operation, output)) {
171  return true;
172  }
173  operation = get_input_operation(0);
174  if (operation->determine_depending_area_of_interest(&new_input, read_operation, output)) {
175  return true;
176  }
177  operation = get_input_operation(2);
178  if (operation->determine_depending_area_of_interest(input, read_operation, output)) {
179  return true;
180  }
181  if (!sizeavailable_) {
182  rcti size_input;
183  size_input.xmin = 0;
184  size_input.ymin = 0;
185  size_input.xmax = 5;
186  size_input.ymax = 5;
187  operation = get_input_operation(3);
188  if (operation->determine_depending_area_of_interest(&size_input, read_operation, output)) {
189  return true;
190  }
191  }
192  return false;
193 }
194 
196  MemoryBuffer *output_memory_buffer,
197  cl_mem cl_output_buffer,
198  MemoryBuffer **input_memory_buffers,
199  std::list<cl_mem> *cl_mem_to_clean_up,
200  std::list<cl_kernel> * /*cl_kernels_to_clean_up*/)
201 {
202  cl_kernel kernel = device->COM_cl_create_kernel("bokeh_blur_kernel", nullptr);
203  if (!sizeavailable_) {
204  update_size();
205  }
206  const float max_dim = MAX2(this->get_width(), this->get_height());
207  cl_int radius = size_ * max_dim / 100.0f;
208  cl_int step = this->get_step();
209 
211  kernel, 0, -1, cl_mem_to_clean_up, input_memory_buffers, input_bounding_box_reader_);
213  kernel, 1, 4, cl_mem_to_clean_up, input_memory_buffers, input_program_);
215  kernel, 2, -1, cl_mem_to_clean_up, input_memory_buffers, input_bokeh_program_);
217  device->COM_cl_attach_memory_buffer_offset_to_kernel_parameter(kernel, 5, output_memory_buffer);
218  clSetKernelArg(kernel, 6, sizeof(cl_int), &radius);
219  clSetKernelArg(kernel, 7, sizeof(cl_int), &step);
221 
222  device->COM_cl_enqueue_range(kernel, output_memory_buffer, 9, this);
223 }
224 
225 void BokehBlurOperation::update_size()
226 {
227  if (sizeavailable_) {
228  return;
229  }
230 
231  switch (execution_model_) {
232  case eExecutionModel::Tiled: {
233  float result[4];
235  size_ = result[0];
236  CLAMP(size_, 0.0f, 10.0f);
237  break;
238  }
241  if (size_input->get_flags().is_constant_operation) {
242  size_ = *static_cast<ConstantOperation *>(size_input)->get_constant_elem();
243  CLAMP(size_, 0.0f, 10.0f);
244  } /* Else use default. */
245  break;
246  }
247  }
248  sizeavailable_ = true;
249 }
250 
251 void BokehBlurOperation::determine_canvas(const rcti &preferred_area, rcti &r_area)
252 {
253  if (!extend_bounds_) {
254  NodeOperation::determine_canvas(preferred_area, r_area);
255  return;
256  }
257 
258  switch (execution_model_) {
259  case eExecutionModel::Tiled: {
260  NodeOperation::determine_canvas(preferred_area, r_area);
261  const float max_dim = MAX2(BLI_rcti_size_x(&r_area), BLI_rcti_size_y(&r_area));
262  r_area.xmax += 2 * size_ * max_dim / 100.0f;
263  r_area.ymax += 2 * size_ * max_dim / 100.0f;
264  break;
265  }
267  set_determined_canvas_modifier([=](rcti &canvas) {
268  const float max_dim = MAX2(BLI_rcti_size_x(&canvas), BLI_rcti_size_y(&canvas));
269  /* Rounding to even prevents image jiggling in backdrop while switching size values. */
270  float add_size = round_to_even(2 * size_ * max_dim / 100.0f);
271  canvas.xmax += add_size;
272  canvas.ymax += add_size;
273  });
274  NodeOperation::determine_canvas(preferred_area, r_area);
275  break;
276  }
277  }
278 }
279 
281  const rcti &output_area,
282  rcti &r_input_area)
283 {
284  switch (input_idx) {
285  case IMAGE_INPUT_INDEX: {
286  const float max_dim = MAX2(this->get_width(), this->get_height());
287  const float add_size = size_ * max_dim / 100.0f;
288  r_input_area.xmin = output_area.xmin - add_size;
289  r_input_area.xmax = output_area.xmax + add_size;
290  r_input_area.ymin = output_area.ymin - add_size;
291  r_input_area.ymax = output_area.ymax + add_size;
292  break;
293  }
294  case BOKEH_INPUT_INDEX: {
296  r_input_area = bokeh_input->get_canvas();
297  break;
298  }
300  r_input_area = output_area;
301  break;
302  case SIZE_INPUT_INDEX: {
304  break;
305  }
306  }
307 }
308 
310  const rcti &area,
312 {
313  const float max_dim = MAX2(this->get_width(), this->get_height());
314  const int pixel_size = size_ * max_dim / 100.0f;
315  const float m = bokehDimension_ / pixel_size;
316 
317  const MemoryBuffer *image_input = inputs[IMAGE_INPUT_INDEX];
318  const MemoryBuffer *bokeh_input = inputs[BOKEH_INPUT_INDEX];
319  MemoryBuffer *bounding_input = inputs[BOUNDING_BOX_INPUT_INDEX];
320  BuffersIterator<float> it = output->iterate_with({bounding_input}, area);
321  const rcti &image_rect = image_input->get_rect();
322  for (; !it.is_end(); ++it) {
323  const int x = it.x;
324  const int y = it.y;
325  const float bounding_box = *it.in(0);
326  if (bounding_box <= 0.0f) {
327  image_input->read_elem(x, y, it.out);
328  continue;
329  }
330 
331  float color_accum[4] = {0};
332  float multiplier_accum[4] = {0};
333  if (pixel_size < 2) {
334  image_input->read_elem(x, y, color_accum);
335  multiplier_accum[0] = 1.0f;
336  multiplier_accum[1] = 1.0f;
337  multiplier_accum[2] = 1.0f;
338  multiplier_accum[3] = 1.0f;
339  }
340  const int miny = MAX2(y - pixel_size, image_rect.ymin);
341  const int maxy = MIN2(y + pixel_size, image_rect.ymax);
342  const int minx = MAX2(x - pixel_size, image_rect.xmin);
343  const int maxx = MIN2(x + pixel_size, image_rect.xmax);
344  const int step = get_step();
345  const int elem_stride = image_input->elem_stride * step;
346  const int row_stride = image_input->row_stride * step;
347  const float *row_color = image_input->get_elem(minx, miny);
348  for (int ny = miny; ny < maxy; ny += step, row_color += row_stride) {
349  const float *color = row_color;
350  const float v = bokeh_mid_y_ - (ny - y) * m;
351  for (int nx = minx; nx < maxx; nx += step, color += elem_stride) {
352  const float u = bokeh_mid_x_ - (nx - x) * m;
353  float bokeh[4];
354  bokeh_input->read_elem_checked(u, v, bokeh);
355  madd_v4_v4v4(color_accum, bokeh, color);
356  add_v4_v4(multiplier_accum, bokeh);
357  }
358  }
359  it.out[0] = color_accum[0] * (1.0f / multiplier_accum[0]);
360  it.out[1] = color_accum[1] * (1.0f / multiplier_accum[1]);
361  it.out[2] = color_accum[2] * (1.0f / multiplier_accum[2]);
362  it.out[3] = color_accum[3] * (1.0f / multiplier_accum[3]);
363  }
364 }
365 
366 } // namespace blender::compositor
MINLINE float round_to_even(float f)
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void madd_v4_v4v4(float r[4], const float a[4], const float b[4])
MINLINE void zero_v4(float r[4])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:190
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:186
#define MAX2(a, b)
#define MIN2(a, b)
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble ny
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
ATTR_WARN_UNUSED_RESULT const BMVert * v
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void * initialize_tile_data(rcti *rect) override
void execute_pixel(float output[4], int x, int y, void *data) override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void determine_canvas(const rcti &preferred_area, rcti &r_area) override
void execute_opencl(OpenCLDevice *device, MemoryBuffer *output_memory_buffer, cl_mem cl_output_buffer, MemoryBuffer **input_memory_buffers, std::list< cl_mem > *cl_mem_to_clean_up, std::list< cl_kernel > *cl_kernels_to_clean_up) override
custom handle to add new tasks to the OpenCL command queue in order to execute a chunk on an GPUDevic...
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override
Get input operation area being read by this operation on rendering given output area.
a MemoryBuffer contains access to the data of a chunk
void read_elem_checked(int x, int y, float *out) const
const rcti & get_rect() const
get the rect of this MemoryBuffer
const int get_width() const
get the width of this MemoryBuffer
float * get_buffer()
get the data of this MemoryBuffer
void read_elem(int x, int y, float *out) const
NodeOperation contains calculation logic.
void add_output_socket(DataType datatype)
SocketReader * get_input_socket_reader(unsigned int index)
NodeOperation * get_input_operation(int index)
virtual bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output)
void read_sampled(float result[4], float x, float y, PixelSampler sampler)
void set_determined_canvas_modifier(std::function< void(rcti &canvas)> fn)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
virtual void * initialize_tile_data(rcti *)
virtual void determine_canvas(const rcti &preferred_area, rcti &r_area)
device representing an GPU OpenCL device. an instance of this class represents a single cl_device
void COM_cl_attach_size_to_kernel_parameter(cl_kernel kernel, int offset_index, NodeOperation *operation)
cl_mem COM_cl_attach_memory_buffer_to_kernel_parameter(cl_kernel kernel, int parameter_index, int offset_index, std::list< cl_mem > *cleanup, MemoryBuffer **input_memory_buffers, SocketReader *reader)
void COM_cl_attach_output_memory_buffer_to_kernel_parameter(cl_kernel kernel, int parameter_index, cl_mem cl_output_memory_buffer)
void COM_cl_enqueue_range(cl_kernel kernel, MemoryBuffer *output_memory_buffer)
cl_kernel COM_cl_create_kernel(const char *kernelname, std::list< cl_kernel > *cl_kernels_to_clean_up)
void COM_cl_attach_memory_buffer_offset_to_kernel_parameter(cl_kernel kernel, int offset_index, MemoryBuffer *memory_buffers)
SyclQueue void void size_t num_bytes SyclQueue void const char void *memory_device_pointer KernelContext int kernel
ccl_global float * buffer
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_global KernelShaderEvalInput * input
static void area(int d1, int d2, int e1, int e2, float weights[2])
constexpr int COM_DATA_TYPE_COLOR_CHANNELS
Definition: COM_defines.h:62
constexpr int BOUNDING_BOX_INPUT_INDEX
typename BuffersIteratorBuilder< T >::Iterator BuffersIterator
constexpr rcti COM_CONSTANT_INPUT_AREA_OF_INTEREST
Definition: COM_defines.h:113
static bNodeSocketTemplate inputs[]
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63