Blender  V3.3
cycles/kernel/device/gpu/image.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2017-2022 Blender Foundation */
3 
4 #pragma once
5 
7 
8 #ifdef WITH_NANOVDB
9 # define NDEBUG /* Disable "assert" in device code */
10 # define NANOVDB_USE_INTRINSICS
11 # include "nanovdb/NanoVDB.h"
12 # include "nanovdb/util/SampleFromVoxels.h"
13 #endif
14 
15 /* w0, w1, w2, and w3 are the four cubic B-spline basis functions. */
16 ccl_device float cubic_w0(float a)
17 {
18  return (1.0f / 6.0f) * (a * (a * (-a + 3.0f) - 3.0f) + 1.0f);
19 }
20 ccl_device float cubic_w1(float a)
21 {
22  return (1.0f / 6.0f) * (a * a * (3.0f * a - 6.0f) + 4.0f);
23 }
24 ccl_device float cubic_w2(float a)
25 {
26  return (1.0f / 6.0f) * (a * (a * (-3.0f * a + 3.0f) + 3.0f) + 1.0f);
27 }
28 ccl_device float cubic_w3(float a)
29 {
30  return (1.0f / 6.0f) * (a * a * a);
31 }
32 
33 /* g0 and g1 are the two amplitude functions. */
34 ccl_device float cubic_g0(float a)
35 {
36  return cubic_w0(a) + cubic_w1(a);
37 }
38 ccl_device float cubic_g1(float a)
39 {
40  return cubic_w2(a) + cubic_w3(a);
41 }
42 
43 /* h0 and h1 are the two offset functions */
44 ccl_device float cubic_h0(float a)
45 {
46  return (cubic_w1(a) / cubic_g0(a)) - 1.0f;
47 }
48 ccl_device float cubic_h1(float a)
49 {
50  return (cubic_w3(a) / cubic_g1(a)) + 1.0f;
51 }
52 
53 /* Fast bicubic texture lookup using 4 bilinear lookups, adapted from CUDA samples. */
54 template<typename T>
56  float x,
57  float y)
58 {
60 
61  x = (x * info.width) - 0.5f;
62  y = (y * info.height) - 0.5f;
63 
64  float px = floorf(x);
65  float py = floorf(y);
66  float fx = x - px;
67  float fy = y - py;
68 
69  float g0x = cubic_g0(fx);
70  float g1x = cubic_g1(fx);
71  /* Note +0.5 offset to compensate for CUDA linear filtering convention. */
72  float x0 = (px + cubic_h0(fx) + 0.5f) / info.width;
73  float x1 = (px + cubic_h1(fx) + 0.5f) / info.width;
74  float y0 = (py + cubic_h0(fy) + 0.5f) / info.height;
75  float y1 = (py + cubic_h1(fy) + 0.5f) / info.height;
76 
77  return cubic_g0(fy) * (g0x * ccl_gpu_tex_object_read_2D<T>(tex, x0, y0) +
78  g1x * ccl_gpu_tex_object_read_2D<T>(tex, x1, y0)) +
79  cubic_g1(fy) * (g0x * ccl_gpu_tex_object_read_2D<T>(tex, x0, y1) +
80  g1x * ccl_gpu_tex_object_read_2D<T>(tex, x1, y1));
81 }
82 
83 /* Fast tricubic texture lookup using 8 trilinear lookups. */
84 template<typename T>
86 kernel_tex_image_interp_tricubic(ccl_global const TextureInfo &info, float x, float y, float z)
87 {
89 
90  x = (x * info.width) - 0.5f;
91  y = (y * info.height) - 0.5f;
92  z = (z * info.depth) - 0.5f;
93 
94  float px = floorf(x);
95  float py = floorf(y);
96  float pz = floorf(z);
97  float fx = x - px;
98  float fy = y - py;
99  float fz = z - pz;
100 
101  float g0x = cubic_g0(fx);
102  float g1x = cubic_g1(fx);
103  float g0y = cubic_g0(fy);
104  float g1y = cubic_g1(fy);
105  float g0z = cubic_g0(fz);
106  float g1z = cubic_g1(fz);
107 
108  /* Note +0.5 offset to compensate for CUDA linear filtering convention. */
109  float x0 = (px + cubic_h0(fx) + 0.5f) / info.width;
110  float x1 = (px + cubic_h1(fx) + 0.5f) / info.width;
111  float y0 = (py + cubic_h0(fy) + 0.5f) / info.height;
112  float y1 = (py + cubic_h1(fy) + 0.5f) / info.height;
113  float z0 = (pz + cubic_h0(fz) + 0.5f) / info.depth;
114  float z1 = (pz + cubic_h1(fz) + 0.5f) / info.depth;
115 
116  return g0z * (g0y * (g0x * ccl_gpu_tex_object_read_3D<T>(tex, x0, y0, z0) +
117  g1x * ccl_gpu_tex_object_read_3D<T>(tex, x1, y0, z0)) +
118  g1y * (g0x * ccl_gpu_tex_object_read_3D<T>(tex, x0, y1, z0) +
119  g1x * ccl_gpu_tex_object_read_3D<T>(tex, x1, y1, z0))) +
120  g1z * (g0y * (g0x * ccl_gpu_tex_object_read_3D<T>(tex, x0, y0, z1) +
121  g1x * ccl_gpu_tex_object_read_3D<T>(tex, x1, y0, z1)) +
122  g1y * (g0x * ccl_gpu_tex_object_read_3D<T>(tex, x0, y1, z1) +
123  g1x * ccl_gpu_tex_object_read_3D<T>(tex, x1, y1, z1)));
124 }
125 
126 #ifdef WITH_NANOVDB
127 template<typename T, typename S>
128 ccl_device typename nanovdb::NanoGrid<T>::ValueType kernel_tex_image_interp_tricubic_nanovdb(
129  S &s, float x, float y, float z)
130 {
131  float px = floorf(x);
132  float py = floorf(y);
133  float pz = floorf(z);
134  float fx = x - px;
135  float fy = y - py;
136  float fz = z - pz;
137 
138  float g0x = cubic_g0(fx);
139  float g1x = cubic_g1(fx);
140  float g0y = cubic_g0(fy);
141  float g1y = cubic_g1(fy);
142  float g0z = cubic_g0(fz);
143  float g1z = cubic_g1(fz);
144 
145  float x0 = px + cubic_h0(fx);
146  float x1 = px + cubic_h1(fx);
147  float y0 = py + cubic_h0(fy);
148  float y1 = py + cubic_h1(fy);
149  float z0 = pz + cubic_h0(fz);
150  float z1 = pz + cubic_h1(fz);
151 
152  using namespace nanovdb;
153 
154  return g0z * (g0y * (g0x * s(Vec3f(x0, y0, z0)) + g1x * s(Vec3f(x1, y0, z0))) +
155  g1y * (g0x * s(Vec3f(x0, y1, z0)) + g1x * s(Vec3f(x1, y1, z0)))) +
156  g1z * (g0y * (g0x * s(Vec3f(x0, y0, z1)) + g1x * s(Vec3f(x1, y0, z1))) +
157  g1y * (g0x * s(Vec3f(x0, y1, z1)) + g1x * s(Vec3f(x1, y1, z1))));
158 }
159 
160 template<typename T>
161 ccl_device_noinline typename nanovdb::NanoGrid<T>::ValueType kernel_tex_image_interp_nanovdb(
162  ccl_global const TextureInfo &info, float x, float y, float z, uint interpolation)
163 {
164  using namespace nanovdb;
165 
166  NanoGrid<T> *const grid = (NanoGrid<T> *)info.data;
167  typedef typename nanovdb::NanoGrid<T>::AccessorType AccessorType;
168  AccessorType acc = grid->getAccessor();
169 
170  switch (interpolation) {
172  return SampleFromVoxels<AccessorType, 0, false>(acc)(Vec3f(x, y, z));
174  return SampleFromVoxels<AccessorType, 1, false>(acc)(Vec3f(x - 0.5f, y - 0.5f, z - 0.5f));
175  default:
176  SampleFromVoxels<AccessorType, 1, false> s(acc);
177  return kernel_tex_image_interp_tricubic_nanovdb<T>(s, x - 0.5f, y - 0.5f, z - 0.5f);
178  }
179 }
180 #endif
181 
183 {
184  ccl_global const TextureInfo &info = kernel_data_fetch(texture_info, id);
185 
186  /* float4, byte4, ushort4 and half4 */
187  const int texture_type = info.data_type;
188  if (texture_type == IMAGE_DATA_TYPE_FLOAT4 || texture_type == IMAGE_DATA_TYPE_BYTE4 ||
189  texture_type == IMAGE_DATA_TYPE_HALF4 || texture_type == IMAGE_DATA_TYPE_USHORT4) {
190  if (info.interpolation == INTERPOLATION_CUBIC || info.interpolation == INTERPOLATION_SMART) {
191  return kernel_tex_image_interp_bicubic<float4>(info, x, y);
192  }
193  else {
195  return ccl_gpu_tex_object_read_2D<float4>(tex, x, y);
196  }
197  }
198  /* float, byte and half */
199  else {
200  float f;
201 
202  if (info.interpolation == INTERPOLATION_CUBIC || info.interpolation == INTERPOLATION_SMART) {
203  f = kernel_tex_image_interp_bicubic<float>(info, x, y);
204  }
205  else {
207  f = ccl_gpu_tex_object_read_2D<float>(tex, x, y);
208  }
209 
210  return make_float4(f, f, f, 1.0f);
211  }
212 }
213 
215  int id,
216  float3 P,
218 {
219  ccl_global const TextureInfo &info = kernel_data_fetch(texture_info, id);
220 
221  if (info.use_transform_3d) {
222  P = transform_point(&info.transform_3d, P);
223  }
224 
225  const float x = P.x;
226  const float y = P.y;
227  const float z = P.z;
228 
229  uint interpolation = (interp == INTERPOLATION_NONE) ? info.interpolation : interp;
230  const int texture_type = info.data_type;
231 
232 #ifdef WITH_NANOVDB
233  if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT) {
234  float f = kernel_tex_image_interp_nanovdb<float>(info, x, y, z, interpolation);
235  return make_float4(f, f, f, 1.0f);
236  }
237  if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT3) {
238  nanovdb::Vec3f f = kernel_tex_image_interp_nanovdb<nanovdb::Vec3f>(
239  info, x, y, z, interpolation);
240  return make_float4(f[0], f[1], f[2], 1.0f);
241  }
242  if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FPN) {
243  float f = kernel_tex_image_interp_nanovdb<nanovdb::FpN>(info, x, y, z, interpolation);
244  return make_float4(f, f, f, 1.0f);
245  }
246  if (texture_type == IMAGE_DATA_TYPE_NANOVDB_FP16) {
247  float f = kernel_tex_image_interp_nanovdb<nanovdb::Fp16>(info, x, y, z, interpolation);
248  return make_float4(f, f, f, 1.0f);
249  }
250 #endif
251  if (texture_type == IMAGE_DATA_TYPE_FLOAT4 || texture_type == IMAGE_DATA_TYPE_BYTE4 ||
252  texture_type == IMAGE_DATA_TYPE_HALF4 || texture_type == IMAGE_DATA_TYPE_USHORT4) {
253  if (interpolation == INTERPOLATION_CUBIC || interpolation == INTERPOLATION_SMART) {
254  return kernel_tex_image_interp_tricubic<float4>(info, x, y, z);
255  }
256  else {
258  return ccl_gpu_tex_object_read_3D<float4>(tex, x, y, z);
259  }
260  }
261  else {
262  float f;
263 
264  if (interpolation == INTERPOLATION_CUBIC || interpolation == INTERPOLATION_SMART) {
265  f = kernel_tex_image_interp_tricubic<float>(info, x, y, z);
266  }
267  else {
269  f = ccl_gpu_tex_object_read_3D<float>(tex, x, y, z);
270  }
271 
272  return make_float4(f, f, f, 1.0f);
273  }
274 }
275 
unsigned int uint
Definition: BLI_sys_types.h:67
_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 y1
_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
float float4[4]
CUtexObject ccl_gpu_tex_object_3D
Definition: cuda/compat.h:80
#define ccl_device
Definition: cuda/compat.h:32
#define ccl_global
Definition: cuda/compat.h:43
#define ccl_device_noinline
Definition: cuda/compat.h:40
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
CUtexObject ccl_gpu_tex_object_2D
Definition: cuda/compat.h:79
ccl_device float cubic_w2(float a)
ccl_device float cubic_h0(float a)
ccl_device float cubic_g0(float a)
ccl_device float cubic_w3(float a)
CCL_NAMESPACE_BEGIN ccl_device float cubic_w0(float a)
ccl_device float cubic_w1(float a)
ccl_device_noinline T kernel_tex_image_interp_bicubic(ccl_global const TextureInfo &info, float x, float y)
ccl_device float cubic_g1(float a)
ccl_device float cubic_h1(float a)
ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals kg, int id, float3 P, InterpolationType interp)
ccl_device float4 kernel_tex_image_interp(KernelGlobals kg, int id, float x, float y)
ccl_device_noinline T kernel_tex_image_interp_tricubic(ccl_global const TextureInfo &info, float x, float y, float 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 floorf(x)
Definition: metal/compat.h:224
#define make_float4(x, y, z, w)
Definition: metal/compat.h:205
static unsigned a[3]
Definition: RandGen.cpp:78
@ 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_NANOVDB_FLOAT
Definition: util/texture.h:38
@ IMAGE_DATA_TYPE_NANOVDB_FLOAT3
Definition: util/texture.h:39
@ 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
InterpolationType
Definition: util/texture.h:19
@ INTERPOLATION_LINEAR
Definition: util/texture.h:21
@ INTERPOLATION_SMART
Definition: util/texture.h:24
@ INTERPOLATION_NONE
Definition: util/texture.h:20
@ INTERPOLATION_CLOSEST
Definition: util/texture.h:22
@ INTERPOLATION_CUBIC
Definition: util/texture.h:23