Blender  V3.3
cycles/kernel/device/oneapi/image.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2021-2022 Intel Corporation */
3 
5 
6 /* For oneAPI implementation we do manual lookup and interpolation. */
7 /* TODO: share implementation with ../cpu/image.h. */
8 
9 template<typename T> ccl_device_forceinline T tex_fetch(const TextureInfo &info, int index)
10 {
11  return reinterpret_cast<ccl_global T *>(info.data)[index];
12 }
13 
15 {
16  x %= width;
17  if (x < 0)
18  x += width;
19  return x;
20 }
21 
23 {
24  return clamp(x, 0, width - 1);
25 }
26 
28 {
29  const int data_offset = x + info.width * y + info.width * info.height * z;
30  const int texture_type = info.data_type;
31 
32  /* Float4 */
33  if (texture_type == IMAGE_DATA_TYPE_FLOAT4) {
34  return tex_fetch<float4>(info, data_offset);
35  }
36  /* Byte4 */
37  else if (texture_type == IMAGE_DATA_TYPE_BYTE4) {
38  uchar4 r = tex_fetch<uchar4>(info, data_offset);
39  float f = 1.0f / 255.0f;
40  return make_float4(r.x * f, r.y * f, r.z * f, r.w * f);
41  }
42  /* Ushort4 */
43  else if (texture_type == IMAGE_DATA_TYPE_USHORT4) {
44  ushort4 r = tex_fetch<ushort4>(info, data_offset);
45  float f = 1.0f / 65535.f;
46  return make_float4(r.x * f, r.y * f, r.z * f, r.w * f);
47  }
48  /* Float */
49  else if (texture_type == IMAGE_DATA_TYPE_FLOAT) {
50  float f = tex_fetch<float>(info, data_offset);
51  return make_float4(f, f, f, 1.0f);
52  }
53  /* UShort */
54  else if (texture_type == IMAGE_DATA_TYPE_USHORT) {
55  ushort r = tex_fetch<ushort>(info, data_offset);
56  float f = r * (1.0f / 65535.0f);
57  return make_float4(f, f, f, 1.0f);
58  }
59  else if (texture_type == IMAGE_DATA_TYPE_HALF) {
60  float f = tex_fetch<half>(info, data_offset);
61  return make_float4(f, f, f, 1.0f);
62  }
63  else if (texture_type == IMAGE_DATA_TYPE_HALF4) {
64  half4 r = tex_fetch<half4>(info, data_offset);
65  return make_float4(r.x, r.y, r.z, r.w);
66  }
67  /* Byte */
68  else {
69  uchar r = tex_fetch<uchar>(info, data_offset);
70  float f = r * (1.0f / 255.0f);
71  return make_float4(f, f, f, 1.0f);
72  }
73 }
74 
76 {
77  const TextureInfo &info = kernel_data_fetch(texture_info, id);
78 
79  /* Wrap */
80  if (info.extension == EXTENSION_REPEAT) {
83  }
84  else if (info.extension == EXTENSION_EXTEND) {
87  }
88  else {
89  if (x < 0 || x >= info.width || y < 0 || y >= info.height) {
90  return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
91  }
92  }
93 
94  return svm_image_texture_read(info, x, y, 0);
95 }
96 
98 {
99  const TextureInfo &info = kernel_data_fetch(texture_info, id);
100 
101  /* Wrap */
102  if (info.extension == EXTENSION_REPEAT) {
106  }
107  else if (info.extension == EXTENSION_EXTEND) {
111  }
112  else {
113  if (x < 0 || x >= info.width || y < 0 || y >= info.height || z < 0 || z >= info.depth) {
114  return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
115  }
116  }
117 
118  return svm_image_texture_read(info, x, y, z);
119 }
120 
121 static float svm_image_texture_frac(float x, int *ix)
122 {
123  int i = float_to_int(x) - ((x < 0.0f) ? 1 : 0);
124  *ix = i;
125  return x - (float)i;
126 }
127 
128 #define SET_CUBIC_SPLINE_WEIGHTS(u, t) \
129  { \
130  u[0] = (((-1.0f / 6.0f) * t + 0.5f) * t - 0.5f) * t + (1.0f / 6.0f); \
131  u[1] = ((0.5f * t - 1.0f) * t) * t + (2.0f / 3.0f); \
132  u[2] = ((-0.5f * t + 0.5f) * t + 0.5f) * t + (1.0f / 6.0f); \
133  u[3] = (1.0f / 6.0f) * t * t * t; \
134  } \
135  (void)0
136 
138 {
139  const TextureInfo &info = kernel_data_fetch(texture_info, id);
140 
141  if (info.interpolation == INTERPOLATION_CLOSEST) {
142  /* Closest interpolation. */
143  int ix, iy;
144  svm_image_texture_frac(x * info.width, &ix);
145  svm_image_texture_frac(y * info.height, &iy);
146 
147  return svm_image_texture_read_2d(id, ix, iy);
148  }
149  else if (info.interpolation == INTERPOLATION_LINEAR) {
150  /* Bilinear interpolation. */
151  int ix, iy;
152  float tx = svm_image_texture_frac(x * info.width - 0.5f, &ix);
153  float ty = svm_image_texture_frac(y * info.height - 0.5f, &iy);
154 
155  float4 r;
156  r = (1.0f - ty) * (1.0f - tx) * svm_image_texture_read_2d(id, ix, iy);
157  r += (1.0f - ty) * tx * svm_image_texture_read_2d(id, ix + 1, iy);
158  r += ty * (1.0f - tx) * svm_image_texture_read_2d(id, ix, iy + 1);
159  r += ty * tx * svm_image_texture_read_2d(id, ix + 1, iy + 1);
160  return r;
161  }
162  else {
163  /* Bicubic interpolation. */
164  int ix, iy;
165  float tx = svm_image_texture_frac(x * info.width - 0.5f, &ix);
166  float ty = svm_image_texture_frac(y * info.height - 0.5f, &iy);
167 
168  float u[4], v[4];
171 
172  float4 r = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
173 
174  for (int y = 0; y < 4; y++) {
175  for (int x = 0; x < 4; x++) {
176  float weight = u[x] * v[y];
177  r += weight * svm_image_texture_read_2d(id, ix + x - 1, iy + y - 1);
178  }
179  }
180  return r;
181  }
182 }
183 
184 #ifdef WITH_NANOVDB
185 template<typename T> struct NanoVDBInterpolator {
186 
187  typedef typename nanovdb::NanoGrid<T>::AccessorType AccessorType;
188 
189  static ccl_always_inline float4 read(float r)
190  {
191  return make_float4(r, r, r, 1.0f);
192  }
193 
195  {
196  return make_float4(r[0], r[1], r[2], 1.0f);
197  }
198 
199  static ccl_always_inline float4 interp_3d_closest(const AccessorType &acc,
200  float x,
201  float y,
202  float z)
203  {
204  const nanovdb::Vec3f xyz(x, y, z);
205  return read(nanovdb::SampleFromVoxels<AccessorType, 0, false>(acc)(xyz));
206  }
207 
208  static ccl_always_inline float4 interp_3d_linear(const AccessorType &acc,
209  float x,
210  float y,
211  float z)
212  {
213  const nanovdb::Vec3f xyz(x - 0.5f, y - 0.5f, z - 0.5f);
214  return read(nanovdb::SampleFromVoxels<AccessorType, 1, false>(acc)(xyz));
215  }
216 
217  static float4 interp_3d_cubic(const AccessorType &acc, float x, float y, float z)
218  {
219  int ix, iy, iz;
220  int nix, niy, niz;
221  int pix, piy, piz;
222  int nnix, nniy, nniz;
223  /* Tri-cubic b-spline interpolation. */
224  const float tx = svm_image_texture_frac(x - 0.5f, &ix);
225  const float ty = svm_image_texture_frac(y - 0.5f, &iy);
226  const float tz = svm_image_texture_frac(z - 0.5f, &iz);
227  pix = ix - 1;
228  piy = iy - 1;
229  piz = iz - 1;
230  nix = ix + 1;
231  niy = iy + 1;
232  niz = iz + 1;
233  nnix = ix + 2;
234  nniy = iy + 2;
235  nniz = iz + 2;
236 
237  const int xc[4] = {pix, ix, nix, nnix};
238  const int yc[4] = {piy, iy, niy, nniy};
239  const int zc[4] = {piz, iz, niz, nniz};
240  float u[4], v[4], w[4];
241 
242  /* Some helper macro to keep code reasonable size,
243  * let compiler to inline all the matrix multiplications.
244  */
245 # define DATA(x, y, z) (read(acc.getValue(nanovdb::Coord(xc[x], yc[y], zc[z]))))
246 # define COL_TERM(col, row) \
247  (v[col] * (u[0] * DATA(0, col, row) + u[1] * DATA(1, col, row) + u[2] * DATA(2, col, row) + \
248  u[3] * DATA(3, col, row)))
249 # define ROW_TERM(row) \
250  (w[row] * (COL_TERM(0, row) + COL_TERM(1, row) + COL_TERM(2, row) + COL_TERM(3, row)))
251 
255 
256  /* Actual interpolation. */
257  return ROW_TERM(0) + ROW_TERM(1) + ROW_TERM(2) + ROW_TERM(3);
258 
259 # undef COL_TERM
260 # undef ROW_TERM
261 # undef DATA
262  }
263 
265  interp_3d(const TextureInfo &info, float x, float y, float z, int interp)
266  {
267  using namespace nanovdb;
268 
269  NanoGrid<T> *const grid = (NanoGrid<T> *)info.data;
270  AccessorType acc = grid->getAccessor();
271 
272  switch ((interp == INTERPOLATION_NONE) ? info.interpolation : interp) {
274  return interp_3d_closest(acc, x, y, z);
276  return interp_3d_linear(acc, x, y, z);
277  default:
278  return interp_3d_cubic(acc, x, y, z);
279  }
280  }
281 };
282 #endif /* WITH_NANOVDB */
283 
285 {
286  const TextureInfo &info = kernel_data_fetch(texture_info, id);
287 
288  if (info.use_transform_3d) {
289  Transform tfm = info.transform_3d;
290  P = transform_point(&tfm, P);
291  }
292 
293  float x = P.x;
294  float y = P.y;
295  float z = P.z;
296 
297  uint interpolation = (interp == INTERPOLATION_NONE) ? info.interpolation : interp;
298 
299 #ifdef WITH_NANOVDB
301  return NanoVDBInterpolator<float>::interp_3d(info, x, y, z, interpolation);
302  }
303  else if (info.data_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT3) {
304  return NanoVDBInterpolator<nanovdb::Vec3f>::interp_3d(info, x, y, z, interpolation);
305  }
306  else if (info.data_type == IMAGE_DATA_TYPE_NANOVDB_FPN) {
307  return NanoVDBInterpolator<nanovdb::FpN>::interp_3d(info, x, y, z, interpolation);
308  }
309  else if (info.data_type == IMAGE_DATA_TYPE_NANOVDB_FP16) {
310  return NanoVDBInterpolator<nanovdb::Fp16>::interp_3d(info, x, y, z, interpolation);
311  }
312 #else
317  return make_float4(
319  }
320 #endif
321  else {
322  x *= info.width;
323  y *= info.height;
324  z *= info.depth;
325  }
326 
327  if (interpolation == INTERPOLATION_CLOSEST) {
328  /* Closest interpolation. */
329  int ix, iy, iz;
333 
334  return svm_image_texture_read_3d(id, ix, iy, iz);
335  }
336  else if (interpolation == INTERPOLATION_LINEAR) {
337  /* Trilinear interpolation. */
338  int ix, iy, iz;
339  float tx = svm_image_texture_frac(x - 0.5f, &ix);
340  float ty = svm_image_texture_frac(y - 0.5f, &iy);
341  float tz = svm_image_texture_frac(z - 0.5f, &iz);
342 
343  float4 r;
344  r = (1.0f - tz) * (1.0f - ty) * (1.0f - tx) * svm_image_texture_read_3d(id, ix, iy, iz);
345  r += (1.0f - tz) * (1.0f - ty) * tx * svm_image_texture_read_3d(id, ix + 1, iy, iz);
346  r += (1.0f - tz) * ty * (1.0f - tx) * svm_image_texture_read_3d(id, ix, iy + 1, iz);
347  r += (1.0f - tz) * ty * tx * svm_image_texture_read_3d(id, ix + 1, iy + 1, iz);
348 
349  r += tz * (1.0f - ty) * (1.0f - tx) * svm_image_texture_read_3d(id, ix, iy, iz + 1);
350  r += tz * (1.0f - ty) * tx * svm_image_texture_read_3d(id, ix + 1, iy, iz + 1);
351  r += tz * ty * (1.0f - tx) * svm_image_texture_read_3d(id, ix, iy + 1, iz + 1);
352  r += tz * ty * tx * svm_image_texture_read_3d(id, ix + 1, iy + 1, iz + 1);
353  return r;
354  }
355  else {
356  /* Tri-cubic interpolation. */
357  int ix, iy, iz;
358  float tx = svm_image_texture_frac(x - 0.5f, &ix);
359  float ty = svm_image_texture_frac(y - 0.5f, &iy);
360  float tz = svm_image_texture_frac(z - 0.5f, &iz);
361 
362  float u[4], v[4], w[4];
366 
367  float4 r = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
368 
369  for (int z = 0; z < 4; z++) {
370  for (int y = 0; y < 4; y++) {
371  for (int x = 0; x < 4; x++) {
372  float weight = u[x] * v[y] * w[z];
373  r += weight * svm_image_texture_read_3d(id, ix + x - 1, iy + y - 1, iz + z - 1);
374  }
375  }
376  }
377  return r;
378  }
379 }
380 
381 #undef SET_CUBIC_SPLINE_WEIGHTS
382 
typedef float(TangentPoint)[2]
unsigned char uchar
Definition: BLI_sys_types.h:70
unsigned int uint
Definition: BLI_sys_types.h:67
unsigned short ushort
Definition: BLI_sys_types.h:68
_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 GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_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 GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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
float float4[4]
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
#define ccl_device_forceinline
Definition: cuda/compat.h:35
#define ccl_device
Definition: cuda/compat.h:32
#define ccl_device_inline
Definition: cuda/compat.h:34
#define ccl_global
Definition: cuda/compat.h:43
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
#define ROW_TERM(row)
CCL_NAMESPACE_BEGIN ccl_device_forceinline T tex_fetch(const TextureInfo &info, int index)
#define SET_CUBIC_SPLINE_WEIGHTS(u, t)
static float svm_image_texture_frac(float x, int *ix)
ccl_device_inline float4 svm_image_texture_read_2d(int id, int x, int y)
ccl_device_inline float4 svm_image_texture_read_3d(int id, int x, int y, int z)
ccl_device_inline int svm_image_texture_wrap_periodic(int x, int width)
ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals, int id, float3 P, int interp)
ccl_device_inline int svm_image_texture_wrap_clamp(int x, int width)
ccl_device float4 kernel_tex_image_interp(KernelGlobals, int id, float x, float y)
ccl_device_inline float4 svm_image_texture_read(const TextureInfo &info, int x, int y, int z)
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define kernel_data_fetch(name, index)
struct Vec3f Vec3f
CCL_NAMESPACE_END CCL_NAMESPACE_BEGIN ccl_device_inline float3 transform_point(ccl_private const Transform *t, const float3 a)
ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t)
Definition: math_float2.h:232
static float P(float k)
Definition: math_interp.c:25
#define T
#define make_float4(x, y, z, w)
Definition: metal/compat.h:205
T clamp(const T &a, const T &min, const T &max)
#define ccl_always_inline
Definition: oneapi/compat.h:31
uint64_t data
Definition: util/texture.h:74
uint data_type
Definition: util/texture.h:76
uint extension
Definition: util/texture.h:78
uint use_transform_3d
Definition: util/texture.h:82
uint interpolation
Definition: util/texture.h:78
Transform transform_3d
Definition: util/texture.h:83
Definition: half.h:64
ccl_device_inline int float_to_int(float f)
Definition: util/math.h:410
@ IMAGE_DATA_TYPE_FLOAT
Definition: util/texture.h:33
@ IMAGE_DATA_TYPE_NANOVDB_FP16
Definition: util/texture.h:41
@ IMAGE_DATA_TYPE_FLOAT4
Definition: util/texture.h:30
@ IMAGE_DATA_TYPE_USHORT4
Definition: util/texture.h:36
@ IMAGE_DATA_TYPE_USHORT
Definition: util/texture.h:37
@ IMAGE_DATA_TYPE_NANOVDB_FLOAT
Definition: util/texture.h:38
@ IMAGE_DATA_TYPE_NANOVDB_FLOAT3
Definition: util/texture.h:39
@ IMAGE_DATA_TYPE_HALF
Definition: util/texture.h:35
@ IMAGE_DATA_TYPE_BYTE4
Definition: util/texture.h:31
@ IMAGE_DATA_TYPE_HALF4
Definition: util/texture.h:32
@ IMAGE_DATA_TYPE_NANOVDB_FPN
Definition: util/texture.h:40
#define TEX_IMAGE_MISSING_R
Definition: util/texture.h:12
#define TEX_IMAGE_MISSING_B
Definition: util/texture.h:14
@ INTERPOLATION_LINEAR
Definition: util/texture.h:21
@ INTERPOLATION_NONE
Definition: util/texture.h:20
@ INTERPOLATION_CLOSEST
Definition: util/texture.h:22
@ EXTENSION_REPEAT
Definition: util/texture.h:63
@ EXTENSION_EXTEND
Definition: util/texture.h:65
#define TEX_IMAGE_MISSING_A
Definition: util/texture.h:15
#define TEX_IMAGE_MISSING_G
Definition: util/texture.h:13