Blender  V2.93
kernel_opencl_image.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 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 
17 #ifdef WITH_NANOVDB
18 /* Data type to replace `double` used in the NanoVDB headers. Cycles don't need doubles, and is
19  * safer and more portable to never use double datatype on GPU.
20  * Use a special structure, so that the following is true:
21  * - No unnoticed implicit cast or mathematical operations used on scalar 64bit type
22  * (which rules out trick like using `uint64_t` as a drop-in replacement for double).
23  * - Padding rules are matching exactly `double`
24  * (which rules out array of `uint8_t`). */
25 typedef struct ccl_vdb_double_t {
26  uint64_t i;
27 } ccl_vdb_double_t;
28 
29 # define double ccl_vdb_double_t
30 # include "nanovdb/CNanoVDB.h"
31 # undef double
32 #endif
33 
34 /* For OpenCL we do manual lookup and interpolation. */
35 
37 {
38  const uint tex_offset = id
39 #define KERNEL_TEX(type, name) +1
40 #include "kernel/kernel_textures.h"
41  ;
42 
43  return &((ccl_global TextureInfo *)kg->buffers[0])[tex_offset];
44 }
45 
46 #define tex_fetch(type, info, index) \
47  ((ccl_global type *)(kg->buffers[info->cl_buffer] + info->data))[(index)]
48 
50 {
51  x %= width;
52  if (x < 0)
53  x += width;
54  return x;
55 }
56 
58 {
59  return clamp(x, 0, width - 1);
60 }
61 
63  KernelGlobals *kg, const ccl_global TextureInfo *info, void *acc, int x, int y, int z)
64 {
65  const int data_offset = x + info->width * y + info->width * info->height * z;
66  const int texture_type = info->data_type;
67 
68  /* Float4 */
69  if (texture_type == IMAGE_DATA_TYPE_FLOAT4) {
70  return tex_fetch(float4, info, data_offset);
71  }
72  /* Byte4 */
73  else if (texture_type == IMAGE_DATA_TYPE_BYTE4) {
74  uchar4 r = tex_fetch(uchar4, info, data_offset);
75  float f = 1.0f / 255.0f;
76  return make_float4(r.x * f, r.y * f, r.z * f, r.w * f);
77  }
78  /* Ushort4 */
79  else if (texture_type == IMAGE_DATA_TYPE_USHORT4) {
80  ushort4 r = tex_fetch(ushort4, info, data_offset);
81  float f = 1.0f / 65535.f;
82  return make_float4(r.x * f, r.y * f, r.z * f, r.w * f);
83  }
84  /* Float */
85  else if (texture_type == IMAGE_DATA_TYPE_FLOAT) {
86  float f = tex_fetch(float, info, data_offset);
87  return make_float4(f, f, f, 1.0f);
88  }
89  /* UShort */
90  else if (texture_type == IMAGE_DATA_TYPE_USHORT) {
91  ushort r = tex_fetch(ushort, info, data_offset);
92  float f = r * (1.0f / 65535.0f);
93  return make_float4(f, f, f, 1.0f);
94  }
95 #ifdef WITH_NANOVDB
96  /* NanoVDB Float */
97  else if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT) {
98  cnanovdb_coord coord;
99  coord.mVec[0] = x;
100  coord.mVec[1] = y;
101  coord.mVec[2] = z;
102  float f = cnanovdb_readaccessor_getValueF((cnanovdb_readaccessor *)acc, &coord);
103  return make_float4(f, f, f, 1.0f);
104  }
105  /* NanoVDB Float3 */
106  else if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT3) {
107  cnanovdb_coord coord;
108  coord.mVec[0] = x;
109  coord.mVec[1] = y;
110  coord.mVec[2] = z;
111  cnanovdb_Vec3F f = cnanovdb_readaccessor_getValueF3((cnanovdb_readaccessor *)acc, &coord);
112  return make_float4(f.mVec[0], f.mVec[1], f.mVec[2], 1.0f);
113  }
114 #endif
115 #ifdef __KERNEL_CL_KHR_FP16__
116  /* Half and Half4 are optional in OpenCL */
117  else if (texture_type == IMAGE_DATA_TYPE_HALF) {
118  float f = tex_fetch(half, info, data_offset);
119  return make_float4(f, f, f, 1.0f);
120  }
121  else if (texture_type == IMAGE_DATA_TYPE_HALF4) {
122  half4 r = tex_fetch(half4, info, data_offset);
123  return make_float4(r.x, r.y, r.z, r.w);
124  }
125 #endif
126  /* Byte */
127  else {
128  uchar r = tex_fetch(uchar, info, data_offset);
129  float f = r * (1.0f / 255.0f);
130  return make_float4(f, f, f, 1.0f);
131  }
132 }
133 
134 ccl_device_inline float4
135 svm_image_texture_read_2d(KernelGlobals *kg, int id, void *acc, int x, int y)
136 {
137  const ccl_global TextureInfo *info = kernel_tex_info(kg, id);
138 
139 #ifdef WITH_NANOVDB
140  if (info->data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT &&
141  info->data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT3) {
142 #endif
143  /* Wrap */
144  if (info->extension == EXTENSION_REPEAT) {
145  x = svm_image_texture_wrap_periodic(x, info->width);
146  y = svm_image_texture_wrap_periodic(y, info->height);
147  }
148  else {
149  x = svm_image_texture_wrap_clamp(x, info->width);
150  y = svm_image_texture_wrap_clamp(y, info->height);
151  }
152 #ifdef WITH_NANOVDB
153  }
154 #endif
155 
156  return svm_image_texture_read(kg, info, acc, x, y, 0);
157 }
158 
159 ccl_device_inline float4
160 svm_image_texture_read_3d(KernelGlobals *kg, int id, void *acc, int x, int y, int z)
161 {
162  const ccl_global TextureInfo *info = kernel_tex_info(kg, id);
163 
164 #ifdef WITH_NANOVDB
165  if (info->data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT &&
166  info->data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT3) {
167 #endif
168  /* Wrap */
169  if (info->extension == EXTENSION_REPEAT) {
170  x = svm_image_texture_wrap_periodic(x, info->width);
171  y = svm_image_texture_wrap_periodic(y, info->height);
172  z = svm_image_texture_wrap_periodic(z, info->depth);
173  }
174  else {
175  x = svm_image_texture_wrap_clamp(x, info->width);
176  y = svm_image_texture_wrap_clamp(y, info->height);
177  z = svm_image_texture_wrap_clamp(z, info->depth);
178  }
179 #ifdef WITH_NANOVDB
180  }
181 #endif
182 
183  return svm_image_texture_read(kg, info, acc, x, y, z);
184 }
185 
187 {
188  int i = float_to_int(x) - ((x < 0.0f) ? 1 : 0);
189  *ix = i;
190  return x - (float)i;
191 }
192 
193 #define SET_CUBIC_SPLINE_WEIGHTS(u, t) \
194  { \
195  u[0] = (((-1.0f / 6.0f) * t + 0.5f) * t - 0.5f) * t + (1.0f / 6.0f); \
196  u[1] = ((0.5f * t - 1.0f) * t) * t + (2.0f / 3.0f); \
197  u[2] = ((-0.5f * t + 0.5f) * t + 0.5f) * t + (1.0f / 6.0f); \
198  u[3] = (1.0f / 6.0f) * t * t * t; \
199  } \
200  (void)0
201 
202 ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, float y)
203 {
204  const ccl_global TextureInfo *info = kernel_tex_info(kg, id);
205 
206  if (info->extension == EXTENSION_CLIP) {
207  if (x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) {
208  return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
209  }
210  }
211 
212  if (info->interpolation == INTERPOLATION_CLOSEST) {
213  /* Closest interpolation. */
214  int ix, iy;
215  svm_image_texture_frac(x * info->width, &ix);
216  svm_image_texture_frac(y * info->height, &iy);
217 
218  return svm_image_texture_read_2d(kg, id, NULL, ix, iy);
219  }
220  else if (info->interpolation == INTERPOLATION_LINEAR) {
221  /* Bilinear interpolation. */
222  int ix, iy;
223  float tx = svm_image_texture_frac(x * info->width - 0.5f, &ix);
224  float ty = svm_image_texture_frac(y * info->height - 0.5f, &iy);
225 
226  float4 r;
227  r = (1.0f - ty) * (1.0f - tx) * svm_image_texture_read_2d(kg, id, NULL, ix, iy);
228  r += (1.0f - ty) * tx * svm_image_texture_read_2d(kg, id, NULL, ix + 1, iy);
229  r += ty * (1.0f - tx) * svm_image_texture_read_2d(kg, id, NULL, ix, iy + 1);
230  r += ty * tx * svm_image_texture_read_2d(kg, id, NULL, ix + 1, iy + 1);
231  return r;
232  }
233  else {
234  /* Bicubic interpolation. */
235  int ix, iy;
236  float tx = svm_image_texture_frac(x * info->width - 0.5f, &ix);
237  float ty = svm_image_texture_frac(y * info->height - 0.5f, &iy);
238 
239  float u[4], v[4];
242 
243  float4 r = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
244 
245  for (int y = 0; y < 4; y++) {
246  for (int x = 0; x < 4; x++) {
247  float weight = u[x] * v[y];
248  r += weight * svm_image_texture_read_2d(kg, id, NULL, ix + x - 1, iy + y - 1);
249  }
250  }
251  return r;
252  }
253 }
254 
255 ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals *kg, int id, float3 P, int interp)
256 {
257  const ccl_global TextureInfo *info = kernel_tex_info(kg, id);
258 
259  if (info->use_transform_3d) {
260  Transform tfm = info->transform_3d;
261  P = transform_point(&tfm, P);
262  }
263 
264  float x = P.x;
265  float y = P.y;
266  float z = P.z;
267 
268  uint interpolation = (interp == INTERPOLATION_NONE) ? info->interpolation : interp;
269 
270 #ifdef WITH_NANOVDB
271  cnanovdb_readaccessor acc;
272  if (info->data_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT ||
273  info->data_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT3) {
274  ccl_global cnanovdb_griddata *grid =
275  (ccl_global cnanovdb_griddata *)(kg->buffers[info->cl_buffer] + info->data);
276  cnanovdb_readaccessor_init(&acc, cnanovdb_treedata_rootF(cnanovdb_griddata_tree(grid)));
277  }
278  else {
279  if (info->extension == EXTENSION_CLIP) {
280  if (x < 0.0f || y < 0.0f || z < 0.0f || x > 1.0f || y > 1.0f || z > 1.0f) {
281  return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
282  }
283  }
284 
285  x *= info->width;
286  y *= info->height;
287  z *= info->depth;
288  }
289 # define NANOVDB_ACCESS_POINTER &acc
290 #else
291 # define NANOVDB_ACCESS_POINTER NULL
292 #endif
293 
294  if (interpolation == INTERPOLATION_CLOSEST) {
295  /* Closest interpolation. */
296  int ix, iy, iz;
300 
301  return svm_image_texture_read_3d(kg, id, NANOVDB_ACCESS_POINTER, ix, iy, iz);
302  }
303  else if (interpolation == INTERPOLATION_LINEAR) {
304  /* Trilinear interpolation. */
305  int ix, iy, iz;
306  float tx = svm_image_texture_frac(x - 0.5f, &ix);
307  float ty = svm_image_texture_frac(y - 0.5f, &iy);
308  float tz = svm_image_texture_frac(z - 0.5f, &iz);
309 
310  float4 r;
311  r = (1.0f - tz) * (1.0f - ty) * (1.0f - tx) *
313  r += (1.0f - tz) * (1.0f - ty) * tx *
315  r += (1.0f - tz) * ty * (1.0f - tx) *
317  r += (1.0f - tz) * ty * tx *
318  svm_image_texture_read_3d(kg, id, NANOVDB_ACCESS_POINTER, ix + 1, iy + 1, iz);
319 
320  r += tz * (1.0f - ty) * (1.0f - tx) *
322  r += tz * (1.0f - ty) * tx *
323  svm_image_texture_read_3d(kg, id, NANOVDB_ACCESS_POINTER, ix + 1, iy, iz + 1);
324  r += tz * ty * (1.0f - tx) *
325  svm_image_texture_read_3d(kg, id, NANOVDB_ACCESS_POINTER, ix, iy + 1, iz + 1);
326  r += tz * ty * tx *
327  svm_image_texture_read_3d(kg, id, NANOVDB_ACCESS_POINTER, ix + 1, iy + 1, iz + 1);
328  return r;
329  }
330  else {
331  /* Tricubic interpolation. */
332  int ix, iy, iz;
333  float tx = svm_image_texture_frac(x - 0.5f, &ix);
334  float ty = svm_image_texture_frac(y - 0.5f, &iy);
335  float tz = svm_image_texture_frac(z - 0.5f, &iz);
336 
337  float u[4], v[4], w[4];
341 
342  float4 r = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
343 
344  for (int z = 0; z < 4; z++) {
345  for (int y = 0; y < 4; y++) {
346  for (int x = 0; x < 4; x++) {
347  float weight = u[x] * v[y] * w[z];
348  r += weight * svm_image_texture_read_3d(
349  kg, id, NANOVDB_ACCESS_POINTER, ix + x - 1, iy + y - 1, iz + z - 1);
350  }
351  }
352  }
353  return r;
354  }
355 #undef NANOVDB_ACCESS_POINTER
356 }
357 
358 #undef SET_CUBIC_SPLINE_WEIGHTS
typedef float(TangentPoint)[2]
unsigned char uchar
Definition: BLI_sys_types.h:86
unsigned int uint
Definition: BLI_sys_types.h:83
unsigned short ushort
Definition: BLI_sys_types.h:84
_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 GLsizei width
_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
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
Definition: util_half.h:41
#define ccl_device
#define ccl_device_inline
#define ccl_global
#define make_float4(x, y, z, w)
#define SET_CUBIC_SPLINE_WEIGHTS(u, t)
ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals *kg, int id, float3 P, int interp)
ccl_device_inline ccl_global TextureInfo * kernel_tex_info(KernelGlobals *kg, uint id)
#define NANOVDB_ACCESS_POINTER
ccl_device_inline int svm_image_texture_wrap_periodic(int x, int width)
ccl_device_inline float4 svm_image_texture_read_2d(KernelGlobals *kg, int id, void *acc, int x, int y)
ccl_device_inline int svm_image_texture_wrap_clamp(int x, int width)
ccl_device_inline float4 svm_image_texture_read_3d(KernelGlobals *kg, int id, void *acc, int x, int y, int z)
#define tex_fetch(type, info, index)
ccl_device_inline float4 svm_image_texture_read(KernelGlobals *kg, const ccl_global TextureInfo *info, void *acc, int x, int y, int z)
ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, float y)
ccl_device_inline float svm_image_texture_frac(float x, int *ix)
static float P(float k)
Definition: math_interp.c:41
unsigned __int64 uint64_t
Definition: stdint.h:93
ccl_device_inline int float_to_int(float f)
Definition: util_math.h:321
ccl_device_inline int clamp(int a, int mn, int mx)
Definition: util_math.h:283
ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t)
@ IMAGE_DATA_TYPE_FLOAT
Definition: util_texture.h:55
@ IMAGE_DATA_TYPE_FLOAT4
Definition: util_texture.h:52
@ IMAGE_DATA_TYPE_USHORT4
Definition: util_texture.h:58
@ IMAGE_DATA_TYPE_USHORT
Definition: util_texture.h:59
@ IMAGE_DATA_TYPE_NANOVDB_FLOAT
Definition: util_texture.h:60
@ IMAGE_DATA_TYPE_NANOVDB_FLOAT3
Definition: util_texture.h:61
@ IMAGE_DATA_TYPE_HALF
Definition: util_texture.h:57
@ IMAGE_DATA_TYPE_BYTE4
Definition: util_texture.h:53
@ IMAGE_DATA_TYPE_HALF4
Definition: util_texture.h:54
@ INTERPOLATION_LINEAR
Definition: util_texture.h:40
@ INTERPOLATION_NONE
Definition: util_texture.h:39
@ INTERPOLATION_CLOSEST
Definition: util_texture.h:41
@ EXTENSION_REPEAT
Definition: util_texture.h:86
@ EXTENSION_CLIP
Definition: util_texture.h:90
ccl_device_inline float3 transform_point(const Transform *t, const float3 a)