14 #ifndef NANOVDB_PNANOVDB_H_HAS_BEEN_INCLUDED 15 #define NANOVDB_PNANOVDB_H_HAS_BEEN_INCLUDED 27 #if defined(PNANOVDB_C) 28 #ifndef PNANOVDB_ADDRESS_32 29 #define PNANOVDB_ADDRESS_64 31 #elif defined(PNANOVDB_HLSL) 32 #ifndef PNANOVDB_ADDRESS_64 33 #define PNANOVDB_ADDRESS_32 35 #elif defined(PNANOVDB_GLSL) 36 #ifndef PNANOVDB_ADDRESS_64 37 #define PNANOVDB_ADDRESS_32 45 #if defined(PNANOVDB_C) 48 #ifndef PNANOVDB_CMATH 49 #define PNANOVDB_CMATH 52 #elif defined(PNANOVDB_HLSL) 54 #elif defined(PNANOVDB_GLSL) 64 #if defined(PNANOVDB_BUF_CUSTOM) 66 #elif defined(PNANOVDB_C) 67 #define PNANOVDB_BUF_C 68 #elif defined(PNANOVDB_HLSL) 69 #define PNANOVDB_BUF_HLSL 70 #elif defined(PNANOVDB_GLSL) 71 #define PNANOVDB_BUF_GLSL 74 #if defined(PNANOVDB_BUF_C) 77 #define PNANOVDB_BUF_FORCE_INLINE static inline __forceinline 79 #define PNANOVDB_BUF_FORCE_INLINE static inline __attribute__((always_inline)) 81 typedef struct pnanovdb_buf_t
84 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 85 uint64_t size_in_words;
88 PNANOVDB_BUF_FORCE_INLINE pnanovdb_buf_t pnanovdb_make_buf(uint32_t* data, uint64_t size_in_words)
92 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 93 ret.size_in_words = size_in_words;
97 #if defined(PNANOVDB_ADDRESS_32) 98 PNANOVDB_BUF_FORCE_INLINE uint32_t pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint32_t byte_offset)
100 uint32_t wordaddress = (byte_offset >> 2u);
101 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 102 return wordaddress < buf.size_in_words ? buf.data[wordaddress] : 0u;
104 return buf.data[wordaddress];
107 PNANOVDB_BUF_FORCE_INLINE uint64_t pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint32_t byte_offset)
109 uint64_t* data64 = (uint64_t*)buf.data;
110 uint32_t wordaddress64 = (byte_offset >> 3u);
111 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 112 uint64_t size_in_words64 = buf.size_in_words >> 1u;
113 return wordaddress64 < size_in_words64 ? data64[wordaddress64] : 0llu;
115 return data64[wordaddress64];
118 #elif defined(PNANOVDB_ADDRESS_64) 119 PNANOVDB_BUF_FORCE_INLINE uint32_t pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint64_t byte_offset)
121 uint64_t wordaddress = (byte_offset >> 2u);
122 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 123 return wordaddress < buf.size_in_words ? buf.data[wordaddress] : 0u;
125 return buf.data[wordaddress];
128 PNANOVDB_BUF_FORCE_INLINE uint64_t pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint64_t byte_offset)
130 uint64_t* data64 = (uint64_t*)buf.data;
131 uint64_t wordaddress64 = (byte_offset >> 3u);
132 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 133 uint64_t size_in_words64 = buf.size_in_words >> 1u;
134 return wordaddress64 < size_in_words64 ? data64[wordaddress64] : 0llu;
136 return data64[wordaddress64];
140 typedef uint32_t pnanovdb_grid_type_t;
141 #define PNANOVDB_GRID_TYPE_GET(grid_typeIn, nameIn) pnanovdb_grid_type_constants[grid_typeIn].nameIn 142 #elif defined(PNANOVDB_BUF_HLSL) 143 #if defined(PNANOVDB_ADDRESS_32) 144 #define pnanovdb_buf_t StructuredBuffer<uint> 145 uint pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint byte_offset)
147 return buf[(byte_offset >> 2u)];
149 uint2 pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint byte_offset)
152 ret.x = pnanovdb_buf_read_uint32(buf, byte_offset + 0u);
153 ret.y = pnanovdb_buf_read_uint32(buf, byte_offset + 4u);
156 #elif defined(PNANOVDB_ADDRESS_64) 157 #define pnanovdb_buf_t StructuredBuffer<uint> 158 uint pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint64_t byte_offset)
160 return buf[uint(byte_offset >> 2u)];
162 uint64_t pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint64_t byte_offset)
165 ret = pnanovdb_buf_read_uint32(buf, byte_offset + 0u);
166 ret = ret + (uint64_t(pnanovdb_buf_read_uint32(buf, byte_offset + 4u)) << 32u);
170 #define pnanovdb_grid_type_t uint 171 #define PNANOVDB_GRID_TYPE_GET(grid_typeIn, nameIn) pnanovdb_grid_type_constants[grid_typeIn].nameIn 172 #elif defined(PNANOVDB_BUF_GLSL) 173 struct pnanovdb_buf_t
177 uint pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint byte_offset)
179 return pnanovdb_buf_data[(byte_offset >> 2u)];
181 uvec2 pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint byte_offset)
184 ret.x = pnanovdb_buf_read_uint32(buf, byte_offset + 0u);
185 ret.y = pnanovdb_buf_read_uint32(buf, byte_offset + 4u);
188 #define pnanovdb_grid_type_t uint 189 #define PNANOVDB_GRID_TYPE_GET(grid_typeIn, nameIn) pnanovdb_grid_type_constants[grid_typeIn].nameIn 195 #if defined(PNANOVDB_C) 197 #define PNANOVDB_FORCE_INLINE static inline __forceinline 199 #define PNANOVDB_FORCE_INLINE static inline __attribute__((always_inline)) 201 #elif defined(PNANOVDB_HLSL) 202 #define PNANOVDB_FORCE_INLINE 203 #elif defined(PNANOVDB_GLSL) 204 #define PNANOVDB_FORCE_INLINE 208 #if defined(PNANOVDB_C) 209 #define PNANOVDB_STRUCT_TYPEDEF(X) typedef struct X X; 210 #define PNANOVDB_STATIC_CONST static const 211 #define PNANOVDB_INOUT(X) X* 212 #define PNANOVDB_IN(X) const X* 213 #define PNANOVDB_DEREF(X) (*X) 214 #define PNANOVDB_REF(X) &X 215 #elif defined(PNANOVDB_HLSL) 216 #define PNANOVDB_STRUCT_TYPEDEF(X) 217 #define PNANOVDB_STATIC_CONST static const 218 #define PNANOVDB_INOUT(X) inout X 219 #define PNANOVDB_IN(X) X 220 #define PNANOVDB_DEREF(X) X 221 #define PNANOVDB_REF(X) X 222 #elif defined(PNANOVDB_GLSL) 223 #define PNANOVDB_STRUCT_TYPEDEF(X) 224 #define PNANOVDB_STATIC_CONST const 225 #define PNANOVDB_INOUT(X) inout X 226 #define PNANOVDB_IN(X) X 227 #define PNANOVDB_DEREF(X) X 228 #define PNANOVDB_REF(X) X 232 #if defined(PNANOVDB_C) 233 #define PNANOVDB_NATIVE_64 235 #if !defined(PNANOVDB_MEMCPY_CUSTOM) 237 #define pnanovdb_memcpy memcpy 239 typedef uint32_t pnanovdb_uint32_t;
240 typedef int32_t pnanovdb_int32_t;
241 typedef int32_t pnanovdb_bool_t;
242 #define PNANOVDB_FALSE 0 243 #define PNANOVDB_TRUE 1 244 typedef uint64_t pnanovdb_uint64_t;
245 typedef int64_t pnanovdb_int64_t;
246 typedef struct pnanovdb_coord_t
248 pnanovdb_int32_t x, y, z;
250 typedef struct pnanovdb_vec3_t
254 PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_uint32_as_int32(pnanovdb_uint32_t v) {
return (pnanovdb_int32_t)v; }
255 PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_uint64_as_int64(pnanovdb_uint64_t v) {
return (pnanovdb_int64_t)v; }
256 PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_int64_as_uint64(pnanovdb_int64_t v) {
return (pnanovdb_uint64_t)v; }
257 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_int32_as_uint32(pnanovdb_int32_t v) {
return (pnanovdb_uint32_t)v; }
258 PNANOVDB_FORCE_INLINE
float pnanovdb_uint32_as_float(pnanovdb_uint32_t v) {
float vf; pnanovdb_memcpy(&vf, &v,
sizeof(vf));
return vf; }
259 PNANOVDB_FORCE_INLINE
double pnanovdb_uint64_as_double(pnanovdb_uint64_t v) {
double vf; pnanovdb_memcpy(&vf, &v,
sizeof(vf));
return vf; }
260 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_uint64_low(pnanovdb_uint64_t v) {
return (pnanovdb_uint32_t)v; }
261 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_uint64_high(pnanovdb_uint64_t v) {
return (pnanovdb_uint32_t)(v >> 32u); }
262 PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_uint32_as_uint64(pnanovdb_uint32_t x, pnanovdb_uint32_t y) {
return ((pnanovdb_uint64_t)x) | (((pnanovdb_uint64_t)y) << 32u); }
263 PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_uint32_as_uint64_low(pnanovdb_uint32_t x) {
return ((pnanovdb_uint64_t)x); }
264 PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_uint64_is_equal(pnanovdb_uint64_t a, pnanovdb_uint64_t b) {
return a == b; }
265 PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_int64_is_zero(pnanovdb_int64_t a) {
return a == 0; }
266 #ifdef PNANOVDB_CMATH 267 PNANOVDB_FORCE_INLINE
float pnanovdb_floor(
float v) {
return floorf(v); }
269 PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_float_to_int32(
float v) {
return (pnanovdb_int32_t)v; }
270 PNANOVDB_FORCE_INLINE
float pnanovdb_int32_to_float(pnanovdb_int32_t v) {
return (
float)v; }
271 PNANOVDB_FORCE_INLINE
float pnanovdb_uint32_to_float(pnanovdb_uint32_t v) {
return (
float)v; }
272 PNANOVDB_FORCE_INLINE
float pnanovdb_min(
float a,
float b) {
return a < b ? a : b; }
273 PNANOVDB_FORCE_INLINE
float pnanovdb_max(
float a,
float b) {
return a > b ? a : b; }
274 #elif defined(PNANOVDB_HLSL) 275 typedef uint pnanovdb_uint32_t;
276 typedef int pnanovdb_int32_t;
277 typedef bool pnanovdb_bool_t;
278 #define PNANOVDB_FALSE false 279 #define PNANOVDB_TRUE true 280 typedef int3 pnanovdb_coord_t;
281 typedef float3 pnanovdb_vec3_t;
282 pnanovdb_int32_t pnanovdb_uint32_as_int32(pnanovdb_uint32_t v) {
return int(v); }
283 pnanovdb_uint32_t pnanovdb_int32_as_uint32(pnanovdb_int32_t v) {
return uint(v); }
284 float pnanovdb_uint32_as_float(pnanovdb_uint32_t v) {
return asfloat(v); }
285 float pnanovdb_floor(
float v) {
return floor(v); }
286 pnanovdb_int32_t pnanovdb_float_to_int32(
float v) {
return int(v); }
287 float pnanovdb_int32_to_float(pnanovdb_int32_t v) {
return float(v); }
288 float pnanovdb_uint32_to_float(pnanovdb_uint32_t v) {
return float(v); }
289 float pnanovdb_min(
float a,
float b) {
return min(a, b); }
290 float pnanovdb_max(
float a,
float b) {
return max(a, b); }
291 #if defined(PNANOVDB_ADDRESS_32) 292 typedef uint2 pnanovdb_uint64_t;
293 typedef int2 pnanovdb_int64_t;
294 pnanovdb_int64_t pnanovdb_uint64_as_int64(pnanovdb_uint64_t v) {
return int2(v); }
295 pnanovdb_uint64_t pnanovdb_int64_as_uint64(pnanovdb_int64_t v) {
return uint2(v); }
296 double pnanovdb_uint64_as_double(pnanovdb_uint64_t v) {
return asdouble(v.x, v.y); }
297 pnanovdb_uint32_t pnanovdb_uint64_low(pnanovdb_uint64_t v) {
return v.x; }
298 pnanovdb_uint32_t pnanovdb_uint64_high(pnanovdb_uint64_t v) {
return v.y; }
299 pnanovdb_uint64_t pnanovdb_uint32_as_uint64(pnanovdb_uint32_t x, pnanovdb_uint32_t y) {
return uint2(x, y); }
300 pnanovdb_uint64_t pnanovdb_uint32_as_uint64_low(pnanovdb_uint32_t x) {
return uint2(x, 0); }
301 bool pnanovdb_uint64_is_equal(pnanovdb_uint64_t a, pnanovdb_uint64_t b) {
return (a.x == b.x) && (a.y == b.y); }
302 bool pnanovdb_int64_is_zero(pnanovdb_int64_t a) {
return a.x == 0 && a.y == 0; }
304 typedef uint64_t pnanovdb_uint64_t;
305 typedef int64_t pnanovdb_int64_t;
306 pnanovdb_int64_t pnanovdb_uint64_as_int64(pnanovdb_uint64_t v) {
return int64_t(v); }
307 pnanovdb_uint64_t pnanovdb_int64_as_uint64(pnanovdb_int64_t v) {
return uint64_t(v); }
308 double pnanovdb_uint64_as_double(pnanovdb_uint64_t v) {
return asdouble(uint(v), uint(v >> 32u)); }
309 pnanovdb_uint32_t pnanovdb_uint64_low(pnanovdb_uint64_t v) {
return uint(v); }
310 pnanovdb_uint32_t pnanovdb_uint64_high(pnanovdb_uint64_t v) {
return uint(v >> 32u); }
311 pnanovdb_uint64_t pnanovdb_uint32_as_uint64(pnanovdb_uint32_t x, pnanovdb_uint32_t y) {
return uint64_t(x) + (uint64_t(y) << 32u); }
312 pnanovdb_uint64_t pnanovdb_uint32_as_uint64_low(pnanovdb_uint32_t x) {
return uint64_t(x); }
313 bool pnanovdb_uint64_is_equal(pnanovdb_uint64_t a, pnanovdb_uint64_t b) {
return a == b; }
314 bool pnanovdb_int64_is_zero(pnanovdb_int64_t a) {
return a == 0; }
316 #elif defined(PNANOVDB_GLSL) 317 #define pnanovdb_uint32_t uint 318 #define pnanovdb_int32_t int 319 #define pnanovdb_bool_t bool 320 #define PNANOVDB_FALSE false 321 #define PNANOVDB_TRUE true 322 #define pnanovdb_uint64_t uvec2 323 #define pnanovdb_int64_t ivec2 324 #define pnanovdb_coord_t ivec3 325 #define pnanovdb_vec3_t vec3 326 pnanovdb_int32_t pnanovdb_uint32_as_int32(pnanovdb_uint32_t v) {
return int(v); }
327 pnanovdb_int64_t pnanovdb_uint64_as_int64(pnanovdb_uint64_t v) {
return ivec2(v); }
328 pnanovdb_uint64_t pnanovdb_int64_as_uint64(pnanovdb_int64_t v) {
return uvec2(v); }
329 pnanovdb_uint32_t pnanovdb_int32_as_uint32(pnanovdb_int32_t v) {
return uint(v); }
330 float pnanovdb_uint32_as_float(pnanovdb_uint32_t v) {
return uintBitsToFloat(v); }
331 double pnanovdb_uint64_as_double(pnanovdb_uint64_t v) {
return packDouble2x32(uvec2(v.x, v.y)); }
332 pnanovdb_uint32_t pnanovdb_uint64_low(pnanovdb_uint64_t v) {
return v.x; }
333 pnanovdb_uint32_t pnanovdb_uint64_high(pnanovdb_uint64_t v) {
return v.y; }
334 pnanovdb_uint64_t pnanovdb_uint32_as_uint64(pnanovdb_uint32_t x, pnanovdb_uint32_t y) {
return uvec2(x, y); }
335 pnanovdb_uint64_t pnanovdb_uint32_as_uint64_low(pnanovdb_uint32_t x) {
return uvec2(x, 0); }
336 bool pnanovdb_uint64_is_equal(pnanovdb_uint64_t a, pnanovdb_uint64_t b) {
return (a.x == b.x) && (a.y == b.y); }
337 bool pnanovdb_int64_is_zero(pnanovdb_int64_t a) {
return a.x == 0 && a.y == 0; }
338 float pnanovdb_floor(
float v) {
return floor(v); }
339 pnanovdb_int32_t pnanovdb_float_to_int32(
float v) {
return int(v); }
340 float pnanovdb_int32_to_float(pnanovdb_int32_t v) {
return float(v); }
341 float pnanovdb_uint32_to_float(pnanovdb_uint32_t v) {
return float(v); }
342 float pnanovdb_min(
float a,
float b) {
return min(a, b); }
343 float pnanovdb_max(
float a,
float b) {
return max(a, b); }
348 #if defined(PNANOVDB_C) 349 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_uniform(
float a)
357 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_add(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
365 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_sub(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
373 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_mul(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
381 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_div(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
389 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_min(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
392 v.x = a.x < b.x ? a.x : b.x;
393 v.y = a.y < b.y ? a.y : b.y;
394 v.z = a.z < b.z ? a.z : b.z;
397 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_max(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
400 v.x = a.x > b.x ? a.x : b.x;
401 v.y = a.y > b.y ? a.y : b.y;
402 v.z = a.z > b.z ? a.z : b.z;
405 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_coord_to_vec3(
const pnanovdb_coord_t coord)
408 v.x = pnanovdb_int32_to_float(coord.x);
409 v.y = pnanovdb_int32_to_float(coord.y);
410 v.z = pnanovdb_int32_to_float(coord.z);
413 PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_coord_uniform(
const pnanovdb_int32_t a)
421 PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_coord_add(pnanovdb_coord_t a, pnanovdb_coord_t b)
429 #elif defined(PNANOVDB_HLSL) 430 pnanovdb_vec3_t pnanovdb_vec3_uniform(
float a) {
return float3(a, a, a); }
431 pnanovdb_vec3_t pnanovdb_vec3_add(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a + b; }
432 pnanovdb_vec3_t pnanovdb_vec3_sub(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a - b; }
433 pnanovdb_vec3_t pnanovdb_vec3_mul(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a * b; }
434 pnanovdb_vec3_t pnanovdb_vec3_div(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a / b; }
435 pnanovdb_vec3_t pnanovdb_vec3_min(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return min(a, b); }
436 pnanovdb_vec3_t pnanovdb_vec3_max(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return max(a, b); }
437 pnanovdb_vec3_t pnanovdb_coord_to_vec3(pnanovdb_coord_t coord) {
return float3(coord); }
438 pnanovdb_coord_t pnanovdb_coord_uniform(pnanovdb_int32_t a) {
return int3(a, a, a); }
439 pnanovdb_coord_t pnanovdb_coord_add(pnanovdb_coord_t a, pnanovdb_coord_t b) {
return a + b; }
440 #elif defined(PNANOVDB_GLSL) 441 pnanovdb_vec3_t pnanovdb_vec3_uniform(
float a) {
return vec3(a, a, a); }
442 pnanovdb_vec3_t pnanovdb_vec3_add(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a + b; }
443 pnanovdb_vec3_t pnanovdb_vec3_sub(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a - b; }
444 pnanovdb_vec3_t pnanovdb_vec3_mul(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a * b; }
445 pnanovdb_vec3_t pnanovdb_vec3_div(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a / b; }
446 pnanovdb_vec3_t pnanovdb_vec3_min(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return min(a, b); }
447 pnanovdb_vec3_t pnanovdb_vec3_max(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return max(a, b); }
448 pnanovdb_vec3_t pnanovdb_coord_to_vec3(
const pnanovdb_coord_t coord) {
return vec3(coord); }
449 pnanovdb_coord_t pnanovdb_coord_uniform(pnanovdb_int32_t a) {
return ivec3(a, a, a); }
450 pnanovdb_coord_t pnanovdb_coord_add(pnanovdb_coord_t a, pnanovdb_coord_t b) {
return a + b; }
455 #if defined(PNANOVDB_ADDRESS_32) 456 struct pnanovdb_address_t
458 pnanovdb_uint32_t byte_offset;
460 PNANOVDB_STRUCT_TYPEDEF(pnanovdb_address_t)
462 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset)
464 pnanovdb_address_t ret = address;
465 ret.byte_offset += byte_offset;
468 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset_neg(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset)
470 pnanovdb_address_t ret = address;
471 ret.byte_offset -= byte_offset;
474 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset_product(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset, pnanovdb_uint32_t multiplier)
476 pnanovdb_address_t ret = address;
477 ret.byte_offset += byte_offset * multiplier;
480 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset64(pnanovdb_address_t address, pnanovdb_uint64_t byte_offset)
482 pnanovdb_address_t ret = address;
484 ret.byte_offset += pnanovdb_uint64_low(byte_offset);
487 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_address_mask(pnanovdb_address_t address, pnanovdb_uint32_t mask)
489 return address.byte_offset & mask;
491 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_mask_inv(pnanovdb_address_t address, pnanovdb_uint32_t mask)
493 pnanovdb_address_t ret = address;
494 ret.byte_offset &= (~mask);
497 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_null()
499 pnanovdb_address_t ret = { 0 };
502 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_address_is_null(pnanovdb_address_t address)
504 return address.byte_offset == 0u;
506 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_address_in_interval(pnanovdb_address_t address, pnanovdb_address_t min_address, pnanovdb_address_t max_address)
508 return address.byte_offset >= min_address.byte_offset && address.byte_offset < max_address.byte_offset;
510 #elif defined(PNANOVDB_ADDRESS_64) 511 struct pnanovdb_address_t
513 pnanovdb_uint64_t byte_offset;
515 PNANOVDB_STRUCT_TYPEDEF(pnanovdb_address_t)
517 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset)
519 pnanovdb_address_t ret = address;
520 ret.byte_offset += byte_offset;
523 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset_neg(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset)
525 pnanovdb_address_t ret = address;
526 ret.byte_offset -= byte_offset;
529 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset_product(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset, pnanovdb_uint32_t multiplier)
531 pnanovdb_address_t ret = address;
532 ret.byte_offset += pnanovdb_uint32_as_uint64_low(byte_offset) * pnanovdb_uint32_as_uint64_low(multiplier);
535 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset64(pnanovdb_address_t address, pnanovdb_uint64_t byte_offset)
537 pnanovdb_address_t ret = address;
538 ret.byte_offset += byte_offset;
541 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_address_mask(pnanovdb_address_t address, pnanovdb_uint32_t mask)
543 return pnanovdb_uint64_low(address.byte_offset) & mask;
545 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_mask_inv(pnanovdb_address_t address, pnanovdb_uint32_t mask)
547 pnanovdb_address_t ret = address;
548 ret.byte_offset &= (~pnanovdb_uint32_as_uint64_low(mask));
551 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_null()
553 pnanovdb_address_t ret = { 0 };
556 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_address_is_null(pnanovdb_address_t address)
558 return address.byte_offset == 0llu;
560 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_address_in_interval(pnanovdb_address_t address, pnanovdb_address_t min_address, pnanovdb_address_t max_address)
562 return address.byte_offset >= min_address.byte_offset && address.byte_offset < max_address.byte_offset;
570 return pnanovdb_buf_read_uint32(buf, address.byte_offset);
574 return pnanovdb_buf_read_uint64(buf, address.byte_offset);
576 PNANOVDB_FORCE_INLINE pnanovdb_int32_t
pnanovdb_read_int32(pnanovdb_buf_t buf, pnanovdb_address_t address)
584 PNANOVDB_FORCE_INLINE pnanovdb_int64_t
pnanovdb_read_int64(pnanovdb_buf_t buf, pnanovdb_address_t address)
592 PNANOVDB_FORCE_INLINE pnanovdb_coord_t
pnanovdb_read_coord(pnanovdb_buf_t buf, pnanovdb_address_t address)
594 pnanovdb_coord_t ret;
595 ret.x = pnanovdb_uint32_as_int32(
pnanovdb_read_uint32(buf, pnanovdb_address_offset(address, 0u)));
596 ret.y = pnanovdb_uint32_as_int32(
pnanovdb_read_uint32(buf, pnanovdb_address_offset(address, 4u)));
597 ret.z = pnanovdb_uint32_as_int32(
pnanovdb_read_uint32(buf, pnanovdb_address_offset(address, 8u)));
601 PNANOVDB_FORCE_INLINE pnanovdb_bool_t
pnanovdb_read_bit(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_uint32_t bit_offset)
603 pnanovdb_address_t word_address = pnanovdb_address_mask_inv(address, 3u);
604 pnanovdb_uint32_t bit_index = (pnanovdb_address_mask(address, 3u) << 3u) + bit_offset;
605 pnanovdb_uint32_t value_word = pnanovdb_buf_read_uint32(buf, word_address.byte_offset);
606 return ((value_word >> bit_index) & 1) != 0u;
609 #if defined(PNANOVDB_C) 610 PNANOVDB_FORCE_INLINE
short pnanovdb_read_half(pnanovdb_buf_t buf, pnanovdb_address_t address)
613 return (
short)(raw >> (pnanovdb_address_mask(address, 2) << 3));
615 #elif defined(PNANOVDB_HLSL) 616 PNANOVDB_FORCE_INLINE
float pnanovdb_read_half(pnanovdb_buf_t buf, pnanovdb_address_t address)
619 return f16tof32(raw >> (pnanovdb_address_mask(address, 2) << 3));
621 #elif defined(PNANOVDB_GLSL) 622 PNANOVDB_FORCE_INLINE
float pnanovdb_read_half(pnanovdb_buf_t buf, pnanovdb_address_t address)
625 return unpackHalf2x16(raw >> (pnanovdb_address_mask(address, 2) << 3)).x;
631 #define PNANOVDB_MAGIC_NUMBER 0x304244566f6e614eUL// "NanoVDB0" in hex - little endian (uint64_t) 633 #define PNANOVDB_MAJOR_VERSION_NUMBER 32// reflects changes to the ABI 634 #define PNANOVDB_MINOR_VERSION_NUMBER 3// reflects changes to the API but not ABI 635 #define PNANOVDB_PATCH_VERSION_NUMBER 3// reflects bug-fixes with no ABI or API changes 637 #define PNANOVDB_GRID_TYPE_UNKNOWN 0 638 #define PNANOVDB_GRID_TYPE_FLOAT 1 639 #define PNANOVDB_GRID_TYPE_DOUBLE 2 640 #define PNANOVDB_GRID_TYPE_INT16 3 641 #define PNANOVDB_GRID_TYPE_INT32 4 642 #define PNANOVDB_GRID_TYPE_INT64 5 643 #define PNANOVDB_GRID_TYPE_VEC3F 6 644 #define PNANOVDB_GRID_TYPE_VEC3D 7 645 #define PNANOVDB_GRID_TYPE_MASK 8 646 #define PNANOVDB_GRID_TYPE_HALF 9 647 #define PNANOVDB_GRID_TYPE_UINT32 10 648 #define PNANOVDB_GRID_TYPE_BOOLEAN 11 649 #define PNANOVDB_GRID_TYPE_RGBA8 12 650 #define PNANOVDB_GRID_TYPE_FP4 13 651 #define PNANOVDB_GRID_TYPE_FP8 14 652 #define PNANOVDB_GRID_TYPE_FP16 15 653 #define PNANOVDB_GRID_TYPE_FPN 16 654 #define PNANOVDB_GRID_TYPE_VEC4F 17 655 #define PNANOVDB_GRID_TYPE_VEC4D 18 656 #define PNANOVDB_GRID_TYPE_END 19 658 #define PNANOVDB_GRID_CLASS_UNKNOWN 0 659 #define PNANOVDB_GRID_CLASS_LEVEL_SET 1 // narrow band levelset, e.g. SDF 660 #define PNANOVDB_GRID_CLASS_FOG_VOLUME 2 // fog volume, e.g. density 661 #define PNANOVDB_GRID_CLASS_STAGGERED 3 // staggered MAC grid, e.g. velocity 662 #define PNANOVDB_GRID_CLASS_POINT_INDEX 4 // point index grid 663 #define PNANOVDB_GRID_CLASS_POINT_DATA 5 // point data grid 664 #define PNANOVDB_GRID_CLASS_TOPOLOGY 6 // grid with active states only (no values) 665 #define PNANOVDB_GRID_CLASS_VOXEL_VOLUME 7 // volume of geometric cubes, e.g. minecraft 666 #define PNANOVDB_GRID_CLASS_END 8 668 #define PNANOVDB_GRID_FLAGS_HAS_LONG_GRID_NAME (1 << 0) 669 #define PNANOVDB_GRID_FLAGS_HAS_BBOX (1 << 1) 670 #define PNANOVDB_GRID_FLAGS_HAS_MIN_MAX (1 << 2) 671 #define PNANOVDB_GRID_FLAGS_HAS_AVERAGE (1 << 3) 672 #define PNANOVDB_GRID_FLAGS_HAS_STD_DEVIATION (1 << 4) 673 #define PNANOVDB_GRID_FLAGS_IS_BREADTH_FIRST (1 << 5) 674 #define PNANOVDB_GRID_FLAGS_END (1 << 6) 676 #define PNANOVDB_LEAF_TYPE_DEFAULT 0 677 #define PNANOVDB_LEAF_TYPE_LITE 1 678 #define PNANOVDB_LEAF_TYPE_FP 2 680 PNANOVDB_STATIC_CONST pnanovdb_uint32_t
pnanovdb_grid_type_value_strides_bits[
PNANOVDB_GRID_TYPE_END] = { 0, 32, 64, 16, 32, 64, 96, 192, 0, 16, 32, 1, 32, 4, 8, 16, 0, 128, 256 };
681 PNANOVDB_STATIC_CONST pnanovdb_uint32_t
pnanovdb_grid_type_table_strides_bits[
PNANOVDB_GRID_TYPE_END] = { 64, 64, 64, 64, 64, 64, 128, 192, 64, 64, 64, 64, 64, 64, 64, 64, 64, 128, 256 };
682 PNANOVDB_STATIC_CONST pnanovdb_uint32_t
pnanovdb_grid_type_minmax_strides_bits[
PNANOVDB_GRID_TYPE_END] = { 0, 32, 64, 16, 32, 64, 96, 192, 8, 16, 32, 8, 32, 32, 32, 32, 32, 128, 256 };
683 PNANOVDB_STATIC_CONST pnanovdb_uint32_t
pnanovdb_grid_type_minmax_aligns_bits[
PNANOVDB_GRID_TYPE_END] = { 0, 32, 64, 16, 32, 64, 32, 64, 8, 16, 32, 8, 32, 32, 32, 32, 32, 32, 64 };
684 PNANOVDB_STATIC_CONST pnanovdb_uint32_t
pnanovdb_grid_type_stat_strides_bits[
PNANOVDB_GRID_TYPE_END] = { 0, 32, 64, 32, 32, 64, 32, 64, 8, 32, 32, 8, 32, 32, 32, 32, 32, 32, 64 };
685 PNANOVDB_STATIC_CONST pnanovdb_uint32_t
pnanovdb_grid_type_leaf_type[
PNANOVDB_GRID_TYPE_END] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 2, 2, 2, 2, 0, 0 };
702 #define PNANOVDB_MAP_SIZE 264 704 #define PNANOVDB_MAP_OFF_MATF 0 705 #define PNANOVDB_MAP_OFF_INVMATF 36 706 #define PNANOVDB_MAP_OFF_VECF 72 707 #define PNANOVDB_MAP_OFF_TAPERF 84 708 #define PNANOVDB_MAP_OFF_MATD 88 709 #define PNANOVDB_MAP_OFF_INVMATD 160 710 #define PNANOVDB_MAP_OFF_VECD 232 711 #define PNANOVDB_MAP_OFF_TAPERD 256 747 pnanovdb_uint32_t grid_name[256 / 4];
749 double world_bbox[6];
750 double voxel_size[3];
755 pnanovdb_uint32_t pad[5];
761 #define PNANOVDB_GRID_SIZE 672 763 #define PNANOVDB_GRID_OFF_MAGIC 0 764 #define PNANOVDB_GRID_OFF_CHECKSUM 8 765 #define PNANOVDB_GRID_OFF_VERSION 16 766 #define PNANOVDB_GRID_OFF_FLAGS 20 767 #define PNANOVDB_GRID_OFF_GRID_INDEX 24 768 #define PNANOVDB_GRID_OFF_GRID_COUNT 28 769 #define PNANOVDB_GRID_OFF_GRID_SIZE 32 770 #define PNANOVDB_GRID_OFF_GRID_NAME 40 771 #define PNANOVDB_GRID_OFF_MAP 296 772 #define PNANOVDB_GRID_OFF_WORLD_BBOX 560 773 #define PNANOVDB_GRID_OFF_VOXEL_SIZE 608 774 #define PNANOVDB_GRID_OFF_GRID_CLASS 632 775 #define PNANOVDB_GRID_OFF_GRID_TYPE 636 776 #define PNANOVDB_GRID_OFF_BLIND_METADATA_OFFSET 640 777 #define PNANOVDB_GRID_OFF_BLIND_METADATA_COUNT 648 829 return (version >> 21u) & ((1u << 11u) - 1u);
833 return (version >> 10u) & ((1u << 11u) - 1u);
837 return version & ((1u << 10u) - 1u);
848 pnanovdb_uint32_t name[256 / 4];
854 #define PNANOVDB_GRIDBLINDMETADATA_SIZE 288 856 #define PNANOVDB_GRIDBLINDMETADATA_OFF_BYTE_OFFSET 0 857 #define PNANOVDB_GRIDBLINDMETADATA_OFF_ELEMENT_COUNT 8 858 #define PNANOVDB_GRIDBLINDMETADATA_OFF_FLAGS 16 859 #define PNANOVDB_GRIDBLINDMETADATA_OFF_SEMANTIC 20 860 #define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_CLASS 24 861 #define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_TYPE 28 862 #define PNANOVDB_GRIDBLINDMETADATA_OFF_NAME 32 904 #define PNANOVDB_TREE_SIZE 64 906 #define PNANOVDB_TREE_OFF_NODE_OFFSET_LEAF 0 907 #define PNANOVDB_TREE_OFF_NODE_OFFSET_LOWER 8 908 #define PNANOVDB_TREE_OFF_NODE_OFFSET_UPPER 16 909 #define PNANOVDB_TREE_OFF_NODE_OFFSET_ROOT 24 910 #define PNANOVDB_TREE_OFF_NODE_COUNT_LEAF 32 911 #define PNANOVDB_TREE_OFF_NODE_COUNT_LOWER 36 912 #define PNANOVDB_TREE_OFF_NODE_COUNT_UPPER 40 913 #define PNANOVDB_TREE_OFF_TILE_COUNT_LEAF 44 914 #define PNANOVDB_TREE_OFF_TILE_COUNT_LOWER 48 915 #define PNANOVDB_TREE_OFF_TILE_COUNT_UPPER 52 916 #define PNANOVDB_TREE_OFF_VOXEL_COUNT 56 964 #define PNANOVDB_ROOT_BASE_SIZE 28 966 #define PNANOVDB_ROOT_OFF_BBOX_MIN 0 967 #define PNANOVDB_ROOT_OFF_BBOX_MAX 12 968 #define PNANOVDB_ROOT_OFF_TABLE_SIZE 24 992 #define PNANOVDB_ROOT_TILE_BASE_SIZE 20 994 #define PNANOVDB_ROOT_TILE_OFF_KEY 0 995 #define PNANOVDB_ROOT_TILE_OFF_CHILD 8 996 #define PNANOVDB_ROOT_TILE_OFF_STATE 16 1013 pnanovdb_uint32_t value_mask[1024];
1014 pnanovdb_uint32_t child_mask[1024];
1022 #define PNANOVDB_UPPER_TABLE_COUNT 32768 1023 #define PNANOVDB_UPPER_BASE_SIZE 8224 1025 #define PNANOVDB_UPPER_OFF_BBOX_MIN 0 1026 #define PNANOVDB_UPPER_OFF_BBOX_MAX 12 1027 #define PNANOVDB_UPPER_OFF_FLAGS 24 1028 #define PNANOVDB_UPPER_OFF_VALUE_MASK 32 1029 #define PNANOVDB_UPPER_OFF_CHILD_MASK 4128 1042 return ((value >> (bit_index & 31u)) & 1) != 0u;
1046 return ((value >> (bit_index & 31u)) & 1) != 0u;
1054 pnanovdb_uint32_t value_mask[128];
1055 pnanovdb_uint32_t child_mask[128];
1063 #define PNANOVDB_LOWER_TABLE_COUNT 4096 1064 #define PNANOVDB_LOWER_BASE_SIZE 1056 1066 #define PNANOVDB_LOWER_OFF_BBOX_MIN 0 1067 #define PNANOVDB_LOWER_OFF_BBOX_MAX 12 1068 #define PNANOVDB_LOWER_OFF_FLAGS 24 1069 #define PNANOVDB_LOWER_OFF_VALUE_MASK 32 1070 #define PNANOVDB_LOWER_OFF_CHILD_MASK 544 1083 return ((value >> (bit_index & 31u)) & 1) != 0u;
1087 return ((value >> (bit_index & 31u)) & 1) != 0u;
1094 pnanovdb_uint32_t value_mask[16];
1102 #define PNANOVDB_LEAF_TABLE_COUNT 512 1103 #define PNANOVDB_LEAF_BASE_SIZE 80 1105 #define PNANOVDB_LEAF_OFF_BBOX_MIN 0 1106 #define PNANOVDB_LEAF_OFF_BBOX_DIF_AND_FLAGS 12 1107 #define PNANOVDB_LEAF_OFF_VALUE_MASK 16 1109 #define PNANOVDB_LEAF_TABLE_NEG_OFF_BBOX_DIF_AND_FLAGS 84 1110 #define PNANOVDB_LEAF_TABLE_NEG_OFF_MINIMUM 16 1111 #define PNANOVDB_LEAF_TABLE_NEG_OFF_QUANTUM 12 1121 return ((value >> (bit_index & 31u)) & 1) != 0u;
1159 {28, 28, 28, 28, 28, 32, 0, 8, 20, 32, 8224, 8224, 8224, 8224, 8224, 270368, 1056, 1056, 1056, 1056, 1056, 33824, 80, 80, 80, 80, 96, 96},
1160 {28, 32, 36, 40, 44, 64, 32, 8, 20, 32, 8224, 8228, 8232, 8236, 8256, 270400, 1056, 1060, 1064, 1068, 1088, 33856, 80, 84, 88, 92, 96, 2144},
1161 {32, 40, 48, 56, 64, 96, 64, 8, 24, 32, 8224, 8232, 8240, 8248, 8256, 270400, 1056, 1064, 1072, 1080, 1088, 33856, 80, 88, 96, 104, 128, 4224},
1162 {28, 30, 32, 36, 40, 64, 16, 8, 20, 32, 8224, 8226, 8228, 8232, 8256, 270400, 1056, 1058, 1060, 1064, 1088, 33856, 80, 82, 84, 88, 96, 1120},
1163 {28, 32, 36, 40, 44, 64, 32, 8, 20, 32, 8224, 8228, 8232, 8236, 8256, 270400, 1056, 1060, 1064, 1068, 1088, 33856, 80, 84, 88, 92, 96, 2144},
1164 {32, 40, 48, 56, 64, 96, 64, 8, 24, 32, 8224, 8232, 8240, 8248, 8256, 270400, 1056, 1064, 1072, 1080, 1088, 33856, 80, 88, 96, 104, 128, 4224},
1165 {28, 40, 52, 64, 68, 96, 96, 16, 20, 32, 8224, 8236, 8248, 8252, 8256, 532544, 1056, 1068, 1080, 1084, 1088, 66624, 80, 92, 104, 108, 128, 6272},
1166 {32, 56, 80, 104, 112, 128, 192, 24, 24, 64, 8224, 8248, 8272, 8280, 8288, 794720, 1056, 1080, 1104, 1112, 1120, 99424, 80, 104, 128, 136, 160, 12448},
1167 {28, 29, 30, 31, 32, 64, 0, 8, 20, 32, 8224, 8225, 8226, 8227, 8256, 270400, 1056, 1057, 1058, 1059, 1088, 33856, 80, 80, 80, 80, 96, 96},
1168 {28, 30, 32, 36, 40, 64, 16, 8, 20, 32, 8224, 8226, 8228, 8232, 8256, 270400, 1056, 1058, 1060, 1064, 1088, 33856, 80, 82, 84, 88, 96, 1120},
1169 {28, 32, 36, 40, 44, 64, 32, 8, 20, 32, 8224, 8228, 8232, 8236, 8256, 270400, 1056, 1060, 1064, 1068, 1088, 33856, 80, 84, 88, 92, 96, 2144},
1170 {28, 29, 30, 31, 32, 64, 1, 8, 20, 32, 8224, 8225, 8226, 8227, 8256, 270400, 1056, 1057, 1058, 1059, 1088, 33856, 80, 80, 80, 80, 96, 160},
1171 {28, 32, 36, 40, 44, 64, 32, 8, 20, 32, 8224, 8228, 8232, 8236, 8256, 270400, 1056, 1060, 1064, 1068, 1088, 33856, 80, 84, 88, 92, 96, 2144},
1172 {28, 32, 36, 40, 44, 64, 0, 8, 20, 32, 8224, 8228, 8232, 8236, 8256, 270400, 1056, 1060, 1064, 1068, 1088, 33856, 88, 90, 92, 94, 96, 352},
1173 {28, 32, 36, 40, 44, 64, 0, 8, 20, 32, 8224, 8228, 8232, 8236, 8256, 270400, 1056, 1060, 1064, 1068, 1088, 33856, 88, 90, 92, 94, 96, 608},
1174 {28, 32, 36, 40, 44, 64, 0, 8, 20, 32, 8224, 8228, 8232, 8236, 8256, 270400, 1056, 1060, 1064, 1068, 1088, 33856, 88, 90, 92, 94, 96, 1120},
1175 {28, 32, 36, 40, 44, 64, 0, 8, 20, 32, 8224, 8228, 8232, 8236, 8256, 270400, 1056, 1060, 1064, 1068, 1088, 33856, 88, 90, 92, 94, 96, 96},
1176 {28, 44, 60, 76, 80, 96, 128, 16, 20, 64, 8224, 8240, 8256, 8260, 8288, 532576, 1056, 1072, 1088, 1092, 1120, 66656, 80, 96, 112, 116, 128, 8320},
1177 {32, 64, 96, 128, 136, 160, 256, 32, 24, 64, 8224, 8256, 8288, 8296, 8320, 1056896, 1056, 1088, 1120, 1128, 1152, 132224, 80, 112, 144, 152, 160, 16544},
1186 meta.
address = pnanovdb_address_offset64(meta.
address, byte_offset);
1195 pnanovdb_address_t address = grid.
address;
1196 address = pnanovdb_address_offset64(address, pnanovdb_int64_as_uint64(byte_offset));
1211 root.
address = pnanovdb_address_offset64(root.
address, byte_offset);
1218 tile.
address = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_size));
1219 tile.
address = pnanovdb_address_offset_product(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_size), n);
1226 tile.
address = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_size));
1239 #if defined(PNANOVDB_NATIVE_64) 1240 pnanovdb_uint64_t iu = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).x) >> 12u;
1241 pnanovdb_uint64_t ju = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).y) >> 12u;
1242 pnanovdb_uint64_t ku = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).z) >> 12u;
1243 return (ku) | (ju << 21u) | (iu << 42u);
1245 pnanovdb_uint32_t iu = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).x) >> 12u;
1246 pnanovdb_uint32_t ju = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).y) >> 12u;
1247 pnanovdb_uint32_t ku = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).z) >> 12u;
1248 pnanovdb_uint32_t key_x = ku | (ju << 21);
1249 pnanovdb_uint32_t key_y = (iu << 10) | (ju >> 11);
1250 return pnanovdb_uint32_as_uint64(key_x, key_y);
1259 for (pnanovdb_uint32_t i = 0u; i < tile_count; i++)
1265 tile.
address = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_size));
1273 return (((PNANOVDB_DEREF(ijk).x & 7) >> 0) << (2 * 3)) +
1274 (((PNANOVDB_DEREF(ijk).y & 7) >> 0) << (3)) +
1275 ((PNANOVDB_DEREF(ijk).z & 7) >> 0);
1280 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, leaf_off_min);
1281 return pnanovdb_address_offset(node.
address, byte_offset);
1286 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, leaf_off_max);
1287 return pnanovdb_address_offset(node.
address, byte_offset);
1292 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, leaf_off_ave);
1293 return pnanovdb_address_offset(node.
address, byte_offset);
1298 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, leaf_off_stddev);
1299 return pnanovdb_address_offset(node.
address, byte_offset);
1304 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, leaf_off_table) + ((PNANOVDB_GRID_TYPE_GET(grid_type, value_stride_bits) * n) >> 3u);
1305 return pnanovdb_address_offset(node.
address, byte_offset);
1314 PNANOVDB_FORCE_INLINE
float pnanovdb_leaf_fp_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t value_log_bits)
1317 pnanovdb_uint32_t value_bits = 1u << value_log_bits;
1318 pnanovdb_uint32_t value_mask = (1u << value_bits) - 1u;
1319 pnanovdb_uint32_t values_per_word_bits = 5u - value_log_bits;
1320 pnanovdb_uint32_t values_per_word_mask = (1u << values_per_word_bits) - 1u;
1325 pnanovdb_uint32_t raw =
pnanovdb_read_uint32(buf, pnanovdb_address_offset(address, ((n >> values_per_word_bits) << 2u)));
1326 pnanovdb_uint32_t value_compressed = (raw >> ((n & values_per_word_mask) << value_log_bits)) & value_mask;
1327 return pnanovdb_uint32_to_float(value_compressed) * quantum + minimum;
1348 pnanovdb_uint32_t flags = bbox_dif_and_flags >> 24u;
1349 pnanovdb_uint32_t value_log_bits = flags >> 5;
1355 return (((PNANOVDB_DEREF(ijk).x & 127) >> 3) << (2 * 4)) +
1356 (((PNANOVDB_DEREF(ijk).y & 127) >> 3) << (4)) +
1357 ((PNANOVDB_DEREF(ijk).z & 127) >> 3);
1362 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_min);
1363 return pnanovdb_address_offset(node.
address, byte_offset);
1368 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_max);
1369 return pnanovdb_address_offset(node.
address, byte_offset);
1374 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_ave);
1375 return pnanovdb_address_offset(node.
address, byte_offset);
1380 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_stddev);
1381 return pnanovdb_address_offset(node.
address, byte_offset);
1386 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_table) + PNANOVDB_GRID_TYPE_GET(grid_type, table_stride) * n;
1387 return pnanovdb_address_offset(node.
address, byte_offset);
1406 pnanovdb_address_t value_address;
1411 PNANOVDB_DEREF(level) = 0u;
1416 PNANOVDB_DEREF(level) = 1u;
1418 return value_address;
1423 pnanovdb_uint32_t level;
1429 return (((PNANOVDB_DEREF(ijk).x & 4095) >> 7) << (2 * 5)) +
1430 (((PNANOVDB_DEREF(ijk).y & 4095) >> 7) << (5)) +
1431 ((PNANOVDB_DEREF(ijk).z & 4095) >> 7);
1436 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_min);
1437 return pnanovdb_address_offset(node.
address, byte_offset);
1442 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_max);
1443 return pnanovdb_address_offset(node.
address, byte_offset);
1448 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_ave);
1449 return pnanovdb_address_offset(node.
address, byte_offset);
1454 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_stddev);
1455 return pnanovdb_address_offset(node.
address, byte_offset);
1460 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_table) + PNANOVDB_GRID_TYPE_GET(grid_type, table_stride) * n;
1461 return pnanovdb_address_offset(node.
address, byte_offset);
1480 pnanovdb_address_t value_address;
1489 PNANOVDB_DEREF(level) = 2u;
1491 return value_address;
1496 pnanovdb_uint32_t level;
1502 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_off_min);
1503 return pnanovdb_address_offset(root.
address, byte_offset);
1508 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_off_max);
1509 return pnanovdb_address_offset(root.
address, byte_offset);
1514 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_off_ave);
1515 return pnanovdb_address_offset(root.
address, byte_offset);
1520 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_off_stddev);
1521 return pnanovdb_address_offset(root.
address, byte_offset);
1526 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_off_value);
1527 return pnanovdb_address_offset(root_tile.
address, byte_offset);
1533 pnanovdb_address_t ret;
1534 if (pnanovdb_address_is_null(tile.
address))
1536 ret = pnanovdb_address_offset(root.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_off_background));
1537 PNANOVDB_DEREF(level) = 4u;
1541 ret = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_off_value));
1542 PNANOVDB_DEREF(level) = 3u;
1554 pnanovdb_uint32_t level;
1560 pnanovdb_uint32_t level;
1562 PNANOVDB_DEREF(bit_index) = level == 0u ? pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).x & 7) : 0u;
1566 PNANOVDB_FORCE_INLINE
float pnanovdb_root_fp4_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
1580 PNANOVDB_FORCE_INLINE
float pnanovdb_root_fp8_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
1594 PNANOVDB_FORCE_INLINE
float pnanovdb_root_fp16_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
1608 PNANOVDB_FORCE_INLINE
float pnanovdb_root_fpn_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
1636 PNANOVDB_DEREF(acc).key.x = 0x7FFFFFFF;
1637 PNANOVDB_DEREF(acc).key.y = 0x7FFFFFFF;
1638 PNANOVDB_DEREF(acc).key.z = 0x7FFFFFFF;
1639 PNANOVDB_DEREF(acc).leaf.address = pnanovdb_address_null();
1640 PNANOVDB_DEREF(acc).lower.address = pnanovdb_address_null();
1641 PNANOVDB_DEREF(acc).upper.address = pnanovdb_address_null();
1642 PNANOVDB_DEREF(acc).root = root;
1647 if (pnanovdb_address_is_null(PNANOVDB_DEREF(acc).leaf.
address)) {
return PNANOVDB_FALSE; }
1648 if ((dirty & ~((1u << 3) - 1u)) != 0)
1650 PNANOVDB_DEREF(acc).leaf.address = pnanovdb_address_null();
1651 return PNANOVDB_FALSE;
1653 return PNANOVDB_TRUE;
1657 if (pnanovdb_address_is_null(PNANOVDB_DEREF(acc).lower.
address)) {
return PNANOVDB_FALSE; }
1658 if ((dirty & ~((1u << 7) - 1u)) != 0)
1660 PNANOVDB_DEREF(acc).lower.address = pnanovdb_address_null();
1661 return PNANOVDB_FALSE;
1663 return PNANOVDB_TRUE;
1667 if (pnanovdb_address_is_null(PNANOVDB_DEREF(acc).upper.
address)) {
return PNANOVDB_FALSE; }
1668 if ((dirty & ~((1u << 12) - 1u)) != 0)
1670 PNANOVDB_DEREF(acc).upper.address = pnanovdb_address_null();
1671 return PNANOVDB_FALSE;
1673 return PNANOVDB_TRUE;
1677 return (PNANOVDB_DEREF(ijk).x ^ PNANOVDB_DEREF(acc).key.x) | (PNANOVDB_DEREF(ijk).y ^ PNANOVDB_DEREF(acc).key.y) | (PNANOVDB_DEREF(ijk).z ^ PNANOVDB_DEREF(acc).key.z);
1689 pnanovdb_address_t value_address;
1693 PNANOVDB_DEREF(acc).leaf =
child;
1694 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
1696 PNANOVDB_DEREF(level) = 0u;
1701 PNANOVDB_DEREF(level) = 1u;
1703 return value_address;
1708 pnanovdb_uint32_t level;
1715 pnanovdb_address_t value_address;
1719 PNANOVDB_DEREF(acc).lower =
child;
1720 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
1726 PNANOVDB_DEREF(level) = 2u;
1728 return value_address;
1733 pnanovdb_uint32_t level;
1740 pnanovdb_address_t ret;
1741 if (pnanovdb_address_is_null(tile.
address))
1743 ret = pnanovdb_address_offset(root.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_off_background));
1744 PNANOVDB_DEREF(level) = 4u;
1748 ret = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_off_value));
1749 PNANOVDB_DEREF(level) = 3u;
1754 PNANOVDB_DEREF(acc).upper =
child;
1755 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
1763 pnanovdb_uint32_t level;
1771 pnanovdb_address_t value_address;
1775 PNANOVDB_DEREF(level) = 0u;
1789 return value_address;
1794 pnanovdb_uint32_t level;
1800 pnanovdb_uint32_t level;
1802 PNANOVDB_DEREF(bit_index) = level == 0u ? pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).x & 7) : 0u;
1816 pnanovdb_uint32_t ret;
1820 PNANOVDB_DEREF(acc).leaf =
child;
1821 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
1834 pnanovdb_uint32_t ret;
1838 PNANOVDB_DEREF(acc).lower =
child;
1839 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
1844 ret = (1u << (4u + 3u));
1852 pnanovdb_uint32_t ret;
1853 if (pnanovdb_address_is_null(tile.
address))
1855 ret = 1u << (5u + 4u + 3u);
1859 ret = 1u << (5u + 4u + 3u);
1864 PNANOVDB_DEREF(acc).upper =
child;
1865 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
1875 pnanovdb_uint32_t dim;
1906 pnanovdb_bool_t is_active;
1910 PNANOVDB_DEREF(acc).leaf =
child;
1911 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
1924 pnanovdb_bool_t is_active;
1928 PNANOVDB_DEREF(acc).lower =
child;
1929 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
1942 pnanovdb_bool_t is_active;
1943 if (pnanovdb_address_is_null(tile.
address))
1945 is_active = PNANOVDB_FALSE;
1950 is_active = state != 0u;
1955 PNANOVDB_DEREF(acc).upper =
child;
1956 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
1966 pnanovdb_bool_t is_active;
1990 pnanovdb_vec3_t dst;
1991 float sx = PNANOVDB_DEREF(src).x;
1992 float sy = PNANOVDB_DEREF(src).y;
1993 float sz = PNANOVDB_DEREF(src).z;
2002 pnanovdb_vec3_t dst;
2014 pnanovdb_vec3_t dst;
2015 float sx = PNANOVDB_DEREF(src).x;
2016 float sy = PNANOVDB_DEREF(src).y;
2017 float sz = PNANOVDB_DEREF(src).z;
2026 pnanovdb_vec3_t dst;
2027 float sx = PNANOVDB_DEREF(src).x;
2028 float sy = PNANOVDB_DEREF(src).y;
2029 float sz = PNANOVDB_DEREF(src).z;
2145 0.14425f, 0.643275f, 0.830409f, 0.331384f, 0.105263f, 0.604289f, 0.167641f, 0.666667f,
2146 0.892788f, 0.393762f, 0.0818713f, 0.580897f, 0.853801f, 0.354776f, 0.916179f, 0.417154f,
2147 0.612086f, 0.11306f, 0.79922f, 0.300195f, 0.510721f, 0.0116959f, 0.947368f, 0.448343f,
2148 0.362573f, 0.861598f, 0.0506823f, 0.549708f, 0.261209f, 0.760234f, 0.19883f, 0.697856f,
2149 0.140351f, 0.639376f, 0.576998f, 0.0779727f, 0.522417f, 0.0233918f, 0.460039f, 0.959064f,
2150 0.888889f, 0.389864f, 0.327485f, 0.826511f, 0.272904f, 0.77193f, 0.709552f, 0.210526f,
2151 0.483431f, 0.982456f, 0.296296f, 0.795322f, 0.116959f, 0.615984f, 0.0545809f, 0.553606f,
2152 0.732943f, 0.233918f, 0.545809f, 0.0467836f, 0.865497f, 0.366472f, 0.803119f, 0.304094f,
2153 0.518519f, 0.0194932f, 0.45614f, 0.955166f, 0.729045f, 0.230019f, 0.54191f, 0.042885f,
2154 0.269006f, 0.768031f, 0.705653f, 0.206628f, 0.479532f, 0.978558f, 0.292398f, 0.791423f,
2155 0.237817f, 0.736842f, 0.424951f, 0.923977f, 0.136452f, 0.635478f, 0.323587f, 0.822612f,
2156 0.986355f, 0.487329f, 0.674464f, 0.175439f, 0.88499f, 0.385965f, 0.573099f, 0.0740741f,
2157 0.51462f, 0.0155945f, 0.202729f, 0.701754f, 0.148148f, 0.647174f, 0.834308f, 0.335283f,
2158 0.265107f, 0.764133f, 0.951267f, 0.452242f, 0.896686f, 0.397661f, 0.08577f, 0.584795f,
2159 0.8577f, 0.358674f, 0.920078f, 0.421053f, 0.740741f, 0.241715f, 0.678363f, 0.179337f,
2160 0.109162f, 0.608187f, 0.17154f, 0.670565f, 0.491228f, 0.990253f, 0.42885f, 0.927875f,
2161 0.0662768f, 0.565302f, 0.62768f, 0.128655f, 0.183236f, 0.682261f, 0.744639f, 0.245614f,
2162 0.814815f, 0.315789f, 0.378168f, 0.877193f, 0.931774f, 0.432749f, 0.495127f, 0.994152f,
2163 0.0350877f, 0.534113f, 0.97076f, 0.471735f, 0.214425f, 0.71345f, 0.526316f, 0.0272904f,
2164 0.783626f, 0.2846f, 0.222222f, 0.721248f, 0.962963f, 0.463938f, 0.276803f, 0.775828f,
2165 0.966862f, 0.467836f, 0.405458f, 0.904483f, 0.0701754f, 0.569201f, 0.881092f, 0.382066f,
2166 0.218324f, 0.717349f, 0.654971f, 0.155945f, 0.818713f, 0.319688f, 0.132554f, 0.631579f,
2167 0.0623782f, 0.561404f, 0.748538f, 0.249513f, 0.912281f, 0.413255f, 0.974659f, 0.475634f,
2168 0.810916f, 0.311891f, 0.499025f, 0.998051f, 0.163743f, 0.662768f, 0.226121f, 0.725146f,
2169 0.690058f, 0.191033f, 0.00389864f, 0.502924f, 0.557505f, 0.0584795f, 0.120858f, 0.619883f,
2170 0.440546f, 0.939571f, 0.752437f, 0.253411f, 0.307992f, 0.807018f, 0.869396f, 0.37037f,
2171 0.658869f, 0.159844f, 0.346979f, 0.846004f, 0.588694f, 0.0896686f, 0.152047f, 0.651072f,
2172 0.409357f, 0.908382f, 0.596491f, 0.0974659f, 0.339181f, 0.838207f, 0.900585f, 0.401559f,
2173 0.34308f, 0.842105f, 0.779727f, 0.280702f, 0.693957f, 0.194932f, 0.25731f, 0.756335f,
2174 0.592593f, 0.0935673f, 0.0311891f, 0.530214f, 0.444444f, 0.94347f, 0.506823f, 0.00779727f,
2175 0.68616f, 0.187135f, 0.124756f, 0.623782f, 0.288499f, 0.787524f, 0.350877f, 0.849903f,
2176 0.436647f, 0.935673f, 0.873294f, 0.374269f, 0.538012f, 0.0389864f, 0.60039f, 0.101365f,
2177 0.57115f, 0.0721248f, 0.758285f, 0.259259f, 0.719298f, 0.220273f, 0.532164f, 0.0331384f,
2178 0.321637f, 0.820663f, 0.00974659f, 0.508772f, 0.469786f, 0.968811f, 0.282651f, 0.781676f,
2179 0.539961f, 0.0409357f, 0.727096f, 0.22807f, 0.500975f, 0.00194932f, 0.563353f, 0.0643275f,
2180 0.290448f, 0.789474f, 0.477583f, 0.976608f, 0.251462f, 0.750487f, 0.31384f, 0.812865f,
2181 0.94152f, 0.442495f, 0.879142f, 0.380117f, 0.37232f, 0.871345f, 0.309942f, 0.808967f,
2182 0.192982f, 0.692008f, 0.130604f, 0.62963f, 0.621832f, 0.122807f, 0.559454f, 0.0604289f,
2183 0.660819f, 0.161793f, 0.723197f, 0.224172f, 0.403509f, 0.902534f, 0.840156f, 0.341131f,
2184 0.411306f, 0.910331f, 0.473684f, 0.97271f, 0.653021f, 0.153996f, 0.0916179f, 0.590643f,
2185 0.196881f, 0.695906f, 0.384016f, 0.883041f, 0.0955166f, 0.594542f, 0.157895f, 0.65692f,
2186 0.945419f, 0.446394f, 0.633528f, 0.134503f, 0.844055f, 0.345029f, 0.906433f, 0.407407f,
2187 0.165692f, 0.664717f, 0.103314f, 0.602339f, 0.126706f, 0.625731f, 0.189084f, 0.688109f,
2188 0.91423f, 0.415205f, 0.851852f, 0.352827f, 0.875244f, 0.376218f, 0.937622f, 0.438596f,
2189 0.317739f, 0.816764f, 0.255361f, 0.754386f, 0.996101f, 0.497076f, 0.933723f, 0.434698f,
2190 0.567251f, 0.0682261f, 0.504873f, 0.00584795f, 0.247563f, 0.746589f, 0.185185f, 0.684211f,
2191 0.037037f, 0.536062f, 0.0994152f, 0.598441f, 0.777778f, 0.278752f, 0.465887f, 0.964912f,
2192 0.785575f, 0.28655f, 0.847953f, 0.348928f, 0.0292398f, 0.528265f, 0.7154f, 0.216374f,
2193 0.39961f, 0.898636f, 0.961014f, 0.461988f, 0.0487329f, 0.547758f, 0.111111f, 0.610136f,
2194 0.649123f, 0.150097f, 0.212476f, 0.711501f, 0.797271f, 0.298246f, 0.859649f, 0.360624f,
2195 0.118908f, 0.617934f, 0.0565302f, 0.555556f, 0.329435f, 0.82846f, 0.516569f, 0.0175439f,
2196 0.867446f, 0.368421f, 0.805068f, 0.306043f, 0.578947f, 0.079922f, 0.267057f, 0.766082f,
2197 0.270955f, 0.76998f, 0.707602f, 0.208577f, 0.668616f, 0.169591f, 0.606238f, 0.107212f,
2198 0.520468f, 0.0214425f, 0.45809f, 0.957115f, 0.419103f, 0.918129f, 0.356725f, 0.855751f,
2199 0.988304f, 0.489279f, 0.426901f, 0.925926f, 0.450292f, 0.949318f, 0.512671f, 0.0136452f,
2200 0.239766f, 0.738791f, 0.676413f, 0.177388f, 0.699805f, 0.20078f, 0.263158f, 0.762183f,
2201 0.773879f, 0.274854f, 0.337232f, 0.836257f, 0.672515f, 0.173489f, 0.734893f, 0.235867f,
2202 0.0253411f, 0.524366f, 0.586745f, 0.0877193f, 0.423002f, 0.922027f, 0.48538f, 0.984405f,
2203 0.74269f, 0.243665f, 0.680312f, 0.181287f, 0.953216f, 0.454191f, 0.1423f, 0.641326f,
2204 0.493177f, 0.992203f, 0.430799f, 0.929825f, 0.204678f, 0.703704f, 0.890838f, 0.391813f,
2205 0.894737f, 0.395712f, 0.0838207f, 0.582846f, 0.0448343f, 0.54386f, 0.231969f, 0.730994f,
2206 0.146199f, 0.645224f, 0.832359f, 0.333333f, 0.793372f, 0.294347f, 0.980507f, 0.481481f,
2207 0.364522f, 0.863548f, 0.80117f, 0.302144f, 0.824561f, 0.325536f, 0.138402f, 0.637427f,
2208 0.614035f, 0.11501f, 0.0526316f, 0.551657f, 0.0760234f, 0.575049f, 0.88694f, 0.387914f,
2213 return enabled ? pnanovdb_dither_lut[offset & 511] : 0.5f;
2218 #ifdef PNANOVDB_HDDA 2221 #define PNANOVDB_ENFORCE_FORWARD_STEPPING 2223 #define PNANOVDB_HDDA_FLOAT_MAX 1e38f 2225 struct pnanovdb_hdda_t
2227 pnanovdb_int32_t dim;
2230 pnanovdb_coord_t voxel;
2231 pnanovdb_coord_t step;
2232 pnanovdb_vec3_t delta;
2233 pnanovdb_vec3_t next;
2235 PNANOVDB_STRUCT_TYPEDEF(pnanovdb_hdda_t)
2237 PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_hdda_pos_to_ijk(PNANOVDB_IN(pnanovdb_vec3_t) pos)
2239 pnanovdb_coord_t voxel;
2240 voxel.x = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).x));
2241 voxel.y = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).y));
2242 voxel.z = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).z));
2246 PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_hdda_pos_to_voxel(PNANOVDB_IN(pnanovdb_vec3_t) pos,
int dim)
2248 pnanovdb_coord_t voxel;
2249 voxel.x = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).x)) & (~(dim - 1));
2250 voxel.y = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).y)) & (~(dim - 1));
2251 voxel.z = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).z)) & (~(dim - 1));
2255 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_hdda_ray_start(PNANOVDB_IN(pnanovdb_vec3_t) origin,
float tmin, PNANOVDB_IN(pnanovdb_vec3_t) direction)
2257 pnanovdb_vec3_t pos = pnanovdb_vec3_add(
2258 pnanovdb_vec3_mul(PNANOVDB_DEREF(direction), pnanovdb_vec3_uniform(tmin)),
2259 PNANOVDB_DEREF(origin)
2264 PNANOVDB_FORCE_INLINE
void pnanovdb_hdda_init(PNANOVDB_INOUT(pnanovdb_hdda_t) hdda, PNANOVDB_IN(pnanovdb_vec3_t) origin,
float tmin, PNANOVDB_IN(pnanovdb_vec3_t) direction,
float tmax,
int dim)
2266 PNANOVDB_DEREF(hdda).dim = dim;
2267 PNANOVDB_DEREF(hdda).tmin = tmin;
2268 PNANOVDB_DEREF(hdda).tmax = tmax;
2270 pnanovdb_vec3_t pos = pnanovdb_hdda_ray_start(origin, tmin, direction);
2271 pnanovdb_vec3_t dir_inv = pnanovdb_vec3_div(pnanovdb_vec3_uniform(1.f), PNANOVDB_DEREF(direction));
2273 PNANOVDB_DEREF(hdda).voxel = pnanovdb_hdda_pos_to_voxel(PNANOVDB_REF(pos), dim);
2276 if (PNANOVDB_DEREF(direction).x == 0.f)
2278 PNANOVDB_DEREF(hdda).next.x = PNANOVDB_HDDA_FLOAT_MAX;
2279 PNANOVDB_DEREF(hdda).step.x = 0;
2280 PNANOVDB_DEREF(hdda).delta.x = 0.f;
2282 else if (dir_inv.x > 0.f)
2284 PNANOVDB_DEREF(hdda).step.x = 1;
2285 PNANOVDB_DEREF(hdda).next.x = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.x + dim - pos.x) * dir_inv.x;
2286 PNANOVDB_DEREF(hdda).delta.x = dir_inv.x;
2290 PNANOVDB_DEREF(hdda).step.x = -1;
2291 PNANOVDB_DEREF(hdda).next.x = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.x - pos.x) * dir_inv.x;
2292 PNANOVDB_DEREF(hdda).delta.x = -dir_inv.x;
2296 if (PNANOVDB_DEREF(direction).y == 0.f)
2298 PNANOVDB_DEREF(hdda).next.y = PNANOVDB_HDDA_FLOAT_MAX;
2299 PNANOVDB_DEREF(hdda).step.y = 0;
2300 PNANOVDB_DEREF(hdda).delta.y = 0.f;
2302 else if (dir_inv.y > 0.f)
2304 PNANOVDB_DEREF(hdda).step.y = 1;
2305 PNANOVDB_DEREF(hdda).next.y = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.y + dim - pos.y) * dir_inv.y;
2306 PNANOVDB_DEREF(hdda).delta.y = dir_inv.y;
2310 PNANOVDB_DEREF(hdda).step.y = -1;
2311 PNANOVDB_DEREF(hdda).next.y = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.y - pos.y) * dir_inv.y;
2312 PNANOVDB_DEREF(hdda).delta.y = -dir_inv.y;
2316 if (PNANOVDB_DEREF(direction).z == 0.f)
2318 PNANOVDB_DEREF(hdda).next.z = PNANOVDB_HDDA_FLOAT_MAX;
2319 PNANOVDB_DEREF(hdda).step.z = 0;
2320 PNANOVDB_DEREF(hdda).delta.z = 0.f;
2322 else if (dir_inv.z > 0.f)
2324 PNANOVDB_DEREF(hdda).step.z = 1;
2325 PNANOVDB_DEREF(hdda).next.z = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.z + dim - pos.z) * dir_inv.z;
2326 PNANOVDB_DEREF(hdda).delta.z = dir_inv.z;
2330 PNANOVDB_DEREF(hdda).step.z = -1;
2331 PNANOVDB_DEREF(hdda).next.z = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.z - pos.z) * dir_inv.z;
2332 PNANOVDB_DEREF(hdda).delta.z = -dir_inv.z;
2336 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_hdda_update(PNANOVDB_INOUT(pnanovdb_hdda_t) hdda, PNANOVDB_IN(pnanovdb_vec3_t) origin, PNANOVDB_IN(pnanovdb_vec3_t) direction,
int dim)
2338 if (PNANOVDB_DEREF(hdda).dim == dim)
2340 return PNANOVDB_FALSE;
2342 PNANOVDB_DEREF(hdda).dim = dim;
2344 pnanovdb_vec3_t pos = pnanovdb_vec3_add(
2345 pnanovdb_vec3_mul(PNANOVDB_DEREF(direction), pnanovdb_vec3_uniform(PNANOVDB_DEREF(hdda).tmin)),
2346 PNANOVDB_DEREF(origin)
2348 pnanovdb_vec3_t dir_inv = pnanovdb_vec3_div(pnanovdb_vec3_uniform(1.f), PNANOVDB_DEREF(direction));
2350 PNANOVDB_DEREF(hdda).voxel = pnanovdb_hdda_pos_to_voxel(PNANOVDB_REF(pos), dim);
2352 if (PNANOVDB_DEREF(hdda).step.x != 0)
2354 PNANOVDB_DEREF(hdda).next.x = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.x - pos.x) * dir_inv.x;
2355 if (PNANOVDB_DEREF(hdda).step.x > 0)
2357 PNANOVDB_DEREF(hdda).next.x += dim * dir_inv.x;
2360 if (PNANOVDB_DEREF(hdda).step.y != 0)
2362 PNANOVDB_DEREF(hdda).next.y = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.y - pos.y) * dir_inv.y;
2363 if (PNANOVDB_DEREF(hdda).step.y > 0)
2365 PNANOVDB_DEREF(hdda).next.y += dim * dir_inv.y;
2368 if (PNANOVDB_DEREF(hdda).step.z != 0)
2370 PNANOVDB_DEREF(hdda).next.z = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.z - pos.z) * dir_inv.z;
2371 if (PNANOVDB_DEREF(hdda).step.z > 0)
2373 PNANOVDB_DEREF(hdda).next.z += dim * dir_inv.z;
2377 return PNANOVDB_TRUE;
2380 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_hdda_step(PNANOVDB_INOUT(pnanovdb_hdda_t) hdda)
2382 pnanovdb_bool_t ret;
2383 if (PNANOVDB_DEREF(hdda).next.x < PNANOVDB_DEREF(hdda).next.y && PNANOVDB_DEREF(hdda).next.x < PNANOVDB_DEREF(hdda).next.z)
2385 #ifdef PNANOVDB_ENFORCE_FORWARD_STEPPING 2386 if (PNANOVDB_DEREF(hdda).next.x <= PNANOVDB_DEREF(hdda).tmin)
2388 PNANOVDB_DEREF(hdda).next.x += PNANOVDB_DEREF(hdda).tmin - 0.999999f * PNANOVDB_DEREF(hdda).next.x + 1.0e-6f;
2391 PNANOVDB_DEREF(hdda).tmin = PNANOVDB_DEREF(hdda).next.x;
2392 PNANOVDB_DEREF(hdda).next.x += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).delta.x;
2393 PNANOVDB_DEREF(hdda).voxel.x += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).step.x;
2394 ret = PNANOVDB_DEREF(hdda).tmin <= PNANOVDB_DEREF(hdda).tmax;
2396 else if (PNANOVDB_DEREF(hdda).next.y < PNANOVDB_DEREF(hdda).next.z)
2398 #ifdef PNANOVDB_ENFORCE_FORWARD_STEPPING 2399 if (PNANOVDB_DEREF(hdda).next.y <= PNANOVDB_DEREF(hdda).tmin)
2401 PNANOVDB_DEREF(hdda).next.y += PNANOVDB_DEREF(hdda).tmin - 0.999999f * PNANOVDB_DEREF(hdda).next.y + 1.0e-6f;
2404 PNANOVDB_DEREF(hdda).tmin = PNANOVDB_DEREF(hdda).next.y;
2405 PNANOVDB_DEREF(hdda).next.y += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).delta.y;
2406 PNANOVDB_DEREF(hdda).voxel.y += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).step.y;
2407 ret = PNANOVDB_DEREF(hdda).tmin <= PNANOVDB_DEREF(hdda).tmax;
2411 #ifdef PNANOVDB_ENFORCE_FORWARD_STEPPING 2412 if (PNANOVDB_DEREF(hdda).next.z <= PNANOVDB_DEREF(hdda).tmin)
2414 PNANOVDB_DEREF(hdda).next.z += PNANOVDB_DEREF(hdda).tmin - 0.999999f * PNANOVDB_DEREF(hdda).next.z + 1.0e-6f;
2417 PNANOVDB_DEREF(hdda).tmin = PNANOVDB_DEREF(hdda).next.z;
2418 PNANOVDB_DEREF(hdda).next.z += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).delta.z;
2419 PNANOVDB_DEREF(hdda).voxel.z += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).step.z;
2420 ret = PNANOVDB_DEREF(hdda).tmin <= PNANOVDB_DEREF(hdda).tmax;
2425 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_hdda_ray_clip(
2426 PNANOVDB_IN(pnanovdb_vec3_t) bbox_min,
2427 PNANOVDB_IN(pnanovdb_vec3_t) bbox_max,
2428 PNANOVDB_IN(pnanovdb_vec3_t) origin, PNANOVDB_INOUT(
float) tmin,
2429 PNANOVDB_IN(pnanovdb_vec3_t) direction, PNANOVDB_INOUT(
float) tmax
2432 pnanovdb_vec3_t dir_inv = pnanovdb_vec3_div(pnanovdb_vec3_uniform(1.f), PNANOVDB_DEREF(direction));
2433 pnanovdb_vec3_t t0 = pnanovdb_vec3_mul(pnanovdb_vec3_sub(PNANOVDB_DEREF(bbox_min), PNANOVDB_DEREF(origin)), dir_inv);
2434 pnanovdb_vec3_t t1 = pnanovdb_vec3_mul(pnanovdb_vec3_sub(PNANOVDB_DEREF(bbox_max), PNANOVDB_DEREF(origin)), dir_inv);
2435 pnanovdb_vec3_t tmin3 = pnanovdb_vec3_min(t0, t1);
2436 pnanovdb_vec3_t tmax3 = pnanovdb_vec3_max(t0, t1);
2437 float tnear = pnanovdb_max(tmin3.x, pnanovdb_max(tmin3.y, tmin3.z));
2438 float tfar = pnanovdb_min(tmax3.x, pnanovdb_min(tmax3.y, tmax3.z));
2439 pnanovdb_bool_t hit = tnear <= tfar;
2440 PNANOVDB_DEREF(tmin) = pnanovdb_max(PNANOVDB_DEREF(tmin), tnear);
2441 PNANOVDB_DEREF(tmax) = pnanovdb_min(PNANOVDB_DEREF(tmax), tfar);
2445 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_hdda_zero_crossing(
2446 pnanovdb_grid_type_t grid_type,
2449 PNANOVDB_IN(pnanovdb_vec3_t) origin,
float tmin,
2450 PNANOVDB_IN(pnanovdb_vec3_t) direction,
float tmax,
2451 PNANOVDB_INOUT(
float) thit,
2452 PNANOVDB_INOUT(
float) v
2457 pnanovdb_vec3_t bbox_minf = pnanovdb_coord_to_vec3(bbox_min);
2458 pnanovdb_vec3_t bbox_maxf = pnanovdb_coord_to_vec3(pnanovdb_coord_add(bbox_max, pnanovdb_coord_uniform(1)));
2460 pnanovdb_bool_t hit = pnanovdb_hdda_ray_clip(PNANOVDB_REF(bbox_minf), PNANOVDB_REF(bbox_maxf), origin, PNANOVDB_REF(tmin), direction, PNANOVDB_REF(tmax));
2461 if (!hit || tmax > 1.0e20f)
2463 return PNANOVDB_FALSE;
2466 pnanovdb_vec3_t pos = pnanovdb_hdda_ray_start(origin, tmin, direction);
2467 pnanovdb_coord_t ijk = pnanovdb_hdda_pos_to_ijk(PNANOVDB_REF(pos));
2473 pnanovdb_hdda_t hdda;
2474 pnanovdb_hdda_init(PNANOVDB_REF(hdda), origin, tmin, direction, tmax, dim);
2475 while (pnanovdb_hdda_step(PNANOVDB_REF(hdda)))
2477 pnanovdb_vec3_t pos_start = pnanovdb_hdda_ray_start(origin, hdda.tmin + 1.0001f, direction);
2478 ijk = pnanovdb_hdda_pos_to_ijk(PNANOVDB_REF(pos_start));
2480 pnanovdb_hdda_update(PNANOVDB_REF(hdda), origin, direction, dim);
2490 if (PNANOVDB_DEREF(v) * v0 < 0.f)
2492 PNANOVDB_DEREF(thit) = hdda.tmin;
2493 return PNANOVDB_TRUE;
2497 return PNANOVDB_FALSE;
2502 #endif // end of NANOVDB_PNANOVDB_H_HAS_BEEN_INCLUDED pnanovdb_map_t map
Definition: PNanoVDB.h:748
PNANOVDB_FORCE_INLINE float pnanovdb_root_fp4_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
Definition: PNanoVDB.h:1566
#define PNANOVDB_GRID_TYPE_END
Definition: PNanoVDB.h:656
pnanovdb_uint32_t node_count_lower
Definition: PNanoVDB.h:893
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_grid_world_to_index_dirf(pnanovdb_buf_t buf, pnanovdb_grid_handle_t grid, PNANOVDB_IN(pnanovdb_vec3_t) src)
Definition: PNanoVDB.h:2048
PNANOVDB_FORCE_INLINE double pnanovdb_map_get_taperd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:734
PNANOVDB_FORCE_INLINE float pnanovdb_leaf_fp4_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1330
PNANOVDB_FORCE_INLINE float pnanovdb_root_fp16_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
Definition: PNanoVDB.h:1594
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_tile_count_leaf(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:939
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_upper_get_stddev_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t node)
Definition: PNanoVDB.h:1452
pnanovdb_coord_t bbox_max
Definition: PNanoVDB.h:1052
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_node_count_lower(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:933
#define PNANOVDB_ROOT_TILE_OFF_KEY
Definition: PNanoVDB.h:994
#define PNANOVDB_GRIDBLINDMETADATA_OFF_BYTE_OFFSET
Definition: PNanoVDB.h:856
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_readaccessor_is_active(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1962
ChildT * child
Definition: GridBuilder.h:1286
#define PNANOVDB_GRID_SIZE
Definition: PNanoVDB.h:761
PNANOVDB_FORCE_INLINE pnanovdb_root_handle_t pnanovdb_tree_get_root(pnanovdb_buf_t buf, pnanovdb_tree_handle_t tree)
Definition: PNanoVDB.h:1207
pnanovdb_uint32_t grid_type
Definition: PNanoVDB.h:752
pnanovdb_uint32_t root_tile_size
Definition: PNanoVDB.h:1135
PNANOVDB_STATIC_CONST pnanovdb_grid_type_constants_t pnanovdb_grid_type_constants[19]
Definition: PNanoVDB.h:1157
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_gridblindmetadata_get_data_type(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:879
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_read_uint32(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:568
Definition: PNanoVDB.h:1124
pnanovdb_lower_handle_t lower
Definition: PNanoVDB.h:1628
#define PNANOVDB_LEAF_OFF_BBOX_MIN
Definition: PNanoVDB.h:1105
#define PNANOVDB_UPPER_OFF_FLAGS
Definition: PNanoVDB.h:1027
Definition: PNanoVDB.h:901
Definition: PNanoVDB.h:738
#define PNANOVDB_MAP_OFF_MATF
Definition: PNanoVDB.h:704
#define PNANOVDB_UPPER_OFF_BBOX_MAX
Definition: PNanoVDB.h:1026
pnanovdb_upper_handle_t upper
Definition: PNanoVDB.h:1629
#define PNANOVDB_LOWER_OFF_BBOX_MAX
Definition: PNanoVDB.h:1067
Definition: PNanoVDB.h:1060
#define PNANOVDB_GRID_OFF_MAGIC
Definition: PNanoVDB.h:763
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_get_stddev_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root)
Definition: PNanoVDB.h:1518
pnanovdb_uint32_t lower_off_max
Definition: PNanoVDB.h:1143
pnanovdb_coord_t key
Definition: PNanoVDB.h:1626
pnanovdb_address_t address
Definition: PNanoVDB.h:989
PNANOVDB_FORCE_INLINE pnanovdb_lower_handle_t pnanovdb_upper_get_child(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t upper, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:1470
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_read_uint64(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:572
#define PNANOVDB_UPPER_OFF_VALUE_MASK
Definition: PNanoVDB.h:1028
PNANOVDB_FORCE_INLINE pnanovdb_tree_handle_t pnanovdb_grid_get_tree(pnanovdb_buf_t buf, pnanovdb_grid_handle_t grid)
Definition: PNanoVDB.h:1200
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_node_offset_upper(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:924
#define PNANOVDB_MAP_OFF_INVMATD
Definition: PNanoVDB.h:709
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_grid_count(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:794
pnanovdb_uint32_t value_stride_bits
Definition: PNanoVDB.h:1132
pnanovdb_uint32_t root_off_max
Definition: PNanoVDB.h:1128
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_readaccessor_iscached2(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, int dirty)
Definition: PNanoVDB.h:1665
PNANOVDB_FORCE_INLINE float pnanovdb_leaf_fp8_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1335
pnanovdb_uint32_t root_size
Definition: PNanoVDB.h:1131
pnanovdb_uint32_t lower_off_min
Definition: PNanoVDB.h:1142
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_upper_get_value_address_and_level_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t upper, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_INOUT(pnanovdb_uint32_t) level)
Definition: PNanoVDB.h:1712
#define PNANOVDB_UPPER_OFF_CHILD_MASK
Definition: PNanoVDB.h:1029
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_upper_get_flags(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p)
Definition: PNanoVDB.h:1037
pnanovdb_address_t address
Definition: PNanoVDB.h:961
pnanovdb_uint64_t voxel_count
Definition: PNanoVDB.h:898
#define PNANOVDB_TREE_OFF_TILE_COUNT_LOWER
Definition: PNanoVDB.h:914
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_grid_index(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:791
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_upper_get_bbox_min(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p)
Definition: PNanoVDB.h:1031
pnanovdb_uint32_t leaf_off_max
Definition: PNanoVDB.h:1149
pnanovdb_address_t address
Definition: PNanoVDB.h:1060
PNANOVDB_FORCE_INLINE int pnanovdb_readaccessor_computedirty(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1675
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_readaccessor_get_dim(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1871
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_upper_is_active_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t upper, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1921
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_lower_get_table_child(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t node, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:1390
Definition: PNanoVDB.h:886
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_readaccessor_iscached0(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, int dirty)
Definition: PNanoVDB.h:1645
#define PNANOVDB_ROOT_OFF_BBOX_MIN
Definition: PNanoVDB.h:966
#define PNANOVDB_GRID_OFF_VOXEL_SIZE
Definition: PNanoVDB.h:773
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_leaf_get_table_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_leaf_handle_t node, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:1302
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_lower_get_value_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t lower, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1421
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_gridblindmetadata_get_byte_offset(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:864
pnanovdb_uint32_t upper_off_table
Definition: PNanoVDB.h:1140
pnanovdb_uint64_t grid_size
Definition: PNanoVDB.h:746
#define PNANOVDB_ROOT_OFF_BBOX_MAX
Definition: PNanoVDB.h:967
#define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_CLASS
Definition: PNanoVDB.h:860
pnanovdb_uint32_t leaf_size
Definition: PNanoVDB.h:1153
#define PNANOVDB_GRID_OFF_FLAGS
Definition: PNanoVDB.h:766
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_voxel_count(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:948
#define PNANOVDB_GRIDBLINDMETADATA_OFF_ELEMENT_COUNT
Definition: PNanoVDB.h:857
pnanovdb_uint32_t upper_size
Definition: PNanoVDB.h:1141
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_read_coord(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:592
pnanovdb_uint32_t root_off_stddev
Definition: PNanoVDB.h:1130
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_lower_get_child_mask(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p, pnanovdb_uint32_t bit_index)
Definition: PNanoVDB.h:1085
#define PNANOVDB_MAP_OFF_VECF
Definition: PNanoVDB.h:706
pnanovdb_int64_t blind_metadata_offset
Definition: PNanoVDB.h:753
PNANOVDB_FORCE_INLINE double pnanovdb_map_get_vecd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:731
PNANOVDB_FORCE_INLINE pnanovdb_gridblindmetadata_handle_t pnanovdb_grid_get_gridblindmetadata(pnanovdb_buf_t buf, pnanovdb_grid_handle_t grid, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1182
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_node_count_leaf(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:930
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_grid_get_blind_metadata_offset(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:820
PNANOVDB_FORCE_INLINE double pnanovdb_grid_get_world_bbox(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:808
pnanovdb_coord_t bbox_min
Definition: PNanoVDB.h:1051
pnanovdb_uint32_t version
Definition: PNanoVDB.h:742
#define PNANOVDB_LOWER_OFF_FLAGS
Definition: PNanoVDB.h:1068
#define PNANOVDB_TREE_OFF_NODE_OFFSET_LOWER
Definition: PNanoVDB.h:907
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_version_get_minor(pnanovdb_uint32_t version)
Definition: PNanoVDB.h:831
Definition: PNanoVDB.h:1090
PNANOVDB_FORCE_INLINE double pnanovdb_map_get_invmatd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:728
#define PNANOVDB_UPPER_OFF_BBOX_MIN
Definition: PNanoVDB.h:1025
Definition: PNanoVDB.h:980
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_lower_get_stddev_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t node)
Definition: PNanoVDB.h:1378
#define PNANOVDB_TREE_OFF_TILE_COUNT_UPPER
Definition: PNanoVDB.h:915
#define PNANOVDB_TREE_OFF_NODE_OFFSET_ROOT
Definition: PNanoVDB.h:909
#define PNANOVDB_ROOT_TILE_OFF_STATE
Definition: PNanoVDB.h:996
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_gridblindmetadata_get_flags(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:870
#define PNANOVDB_MAP_OFF_TAPERF
Definition: PNanoVDB.h:707
#define PNANOVDB_GRIDBLINDMETADATA_OFF_FLAGS
Definition: PNanoVDB.h:858
pnanovdb_uint32_t grid_index
Definition: PNanoVDB.h:744
pnanovdb_uint64_t node_offset_lower
Definition: PNanoVDB.h:889
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_tile_count_upper(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:945
pnanovdb_uint32_t node_count_leaf
Definition: PNanoVDB.h:892
#define PNANOVDB_LOWER_OFF_VALUE_MASK
Definition: PNanoVDB.h:1069
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_grid_name(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:800
pnanovdb_uint64_t checksum
Definition: PNanoVDB.h:741
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_upper_get_bbox_max(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p)
Definition: PNanoVDB.h:1034
#define PNANOVDB_TREE_OFF_TILE_COUNT_LEAF
Definition: PNanoVDB.h:913
pnanovdb_uint32_t pad1
Definition: PNanoVDB.h:985
pnanovdb_uint32_t grid_count
Definition: PNanoVDB.h:745
float taperf
Definition: PNanoVDB.h:692
pnanovdb_uint64_t flags
Definition: PNanoVDB.h:1053
#define PNANOVDB_LOWER_OFF_CHILD_MASK
Definition: PNanoVDB.h:1070
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_tile_count_lower(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:942
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_upper_get_value_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t upper, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1494
pnanovdb_uint32_t lower_off_ave
Definition: PNanoVDB.h:1144
pnanovdb_uint32_t bbox_dif_and_flags
Definition: PNanoVDB.h:1093
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_lower_get_bbox_max(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p)
Definition: PNanoVDB.h:1075
pnanovdb_address_t address
Definition: PNanoVDB.h:758
PNANOVDB_FORCE_INLINE float pnanovdb_dither_lookup(pnanovdb_bool_t enabled, int offset)
Definition: PNanoVDB.h:2211
pnanovdb_coord_t bbox_min
Definition: PNanoVDB.h:1092
PNANOVDB_FORCE_INLINE float pnanovdb_root_fpn_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
Definition: PNanoVDB.h:1608
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_lower_get_value_address_and_level(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t lower, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_uint32_t) level)
Definition: PNanoVDB.h:1403
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_table_strides_bits[19]
Definition: PNanoVDB.h:681
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_leaf_get_bbox_min(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t p)
Definition: PNanoVDB.h:1113
pnanovdb_uint32_t blind_metadata_count
Definition: PNanoVDB.h:754
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_upper_get_value_address_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t upper, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1731
pnanovdb_uint32_t leaf_off_min
Definition: PNanoVDB.h:1148
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_leaf_get_dim_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1808
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_get_max_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root)
Definition: PNanoVDB.h:1506
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_value_strides_bits[19]
Definition: PNanoVDB.h:680
#define PNANOVDB_TREE_OFF_NODE_COUNT_LEAF
Definition: PNanoVDB.h:910
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_lower_is_active_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t lower, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1903
pnanovdb_uint32_t upper_off_min
Definition: PNanoVDB.h:1136
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_readaccessor_iscached1(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, int dirty)
Definition: PNanoVDB.h:1655
pnanovdb_uint32_t table_stride
Definition: PNanoVDB.h:1133
#define PNANOVDB_GRID_OFF_GRID_COUNT
Definition: PNanoVDB.h:768
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_readaccessor_get_value_address_bit(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_uint32_t) bit_index)
Definition: PNanoVDB.h:1798
pnanovdb_uint32_t upper_off_max
Definition: PNanoVDB.h:1137
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_root_get_bbox_max(pnanovdb_buf_t buf, pnanovdb_root_handle_t p)
Definition: PNanoVDB.h:973
#define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_TYPE
Definition: PNanoVDB.h:861
Definition: PNanoVDB.h:952
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_grid_get_magic(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:779
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_root_get_dim_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1849
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_version_get_major(pnanovdb_uint32_t version)
Definition: PNanoVDB.h:827
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_get_ave_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root)
Definition: PNanoVDB.h:1512
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_lower_get_flags(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p)
Definition: PNanoVDB.h:1078
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_node_offset_leaf(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:918
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_minmax_aligns_bits[19]
Definition: PNanoVDB.h:683
PNANOVDB_FORCE_INLINE pnanovdb_leaf_handle_t pnanovdb_lower_get_child(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t lower, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:1396
#define PNANOVDB_LEAF_OFF_BBOX_DIF_AND_FLAGS
Definition: PNanoVDB.h:1106
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_root_tile_get_key(pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t p)
Definition: PNanoVDB.h:998
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_upper_get_min_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t node)
Definition: PNanoVDB.h:1434
pnanovdb_leaf_handle_t leaf
Definition: PNanoVDB.h:1627
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_leaf_get_max_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_leaf_handle_t node)
Definition: PNanoVDB.h:1284
pnanovdb_address_t address
Definition: PNanoVDB.h:699
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_readaccessor_get_value_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1792
PNANOVDB_FORCE_INLINE pnanovdb_root_tile_handle_t pnanovdb_root_get_tile(pnanovdb_grid_type_t grid_type, pnanovdb_root_handle_t root, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:1215
Definition: PNanoVDB.h:1099
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_map_apply_inverse(pnanovdb_buf_t buf, pnanovdb_map_handle_t map, PNANOVDB_IN(pnanovdb_vec3_t) src)
Definition: PNanoVDB.h:2000
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_map_apply_jacobi(pnanovdb_buf_t buf, pnanovdb_map_handle_t map, PNANOVDB_IN(pnanovdb_vec3_t) src)
Definition: PNanoVDB.h:2012
#define PNANOVDB_GRID_TYPE_FLOAT
Definition: PNanoVDB.h:638
pnanovdb_uint32_t lower_off_table
Definition: PNanoVDB.h:1146
#define PNANOVDB_GRIDBLINDMETADATA_OFF_NAME
Definition: PNanoVDB.h:862
#define PNANOVDB_GRIDBLINDMETADATA_SIZE
Definition: PNanoVDB.h:854
PNANOVDB_FORCE_INLINE float pnanovdb_leaf_fp_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t value_log_bits)
Definition: PNanoVDB.h:1314
pnanovdb_uint32_t table_size
Definition: PNanoVDB.h:956
PNANOVDB_FORCE_INLINE float pnanovdb_map_get_matf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:713
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_upper_get_child_mask(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p, pnanovdb_uint32_t bit_index)
Definition: PNanoVDB.h:1044
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_grid_get_checksum(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:782
#define PNANOVDB_LEAF_TABLE_NEG_OFF_BBOX_DIF_AND_FLAGS
Definition: PNanoVDB.h:1109
#define PNANOVDB_GRID_OFF_GRID_TYPE
Definition: PNanoVDB.h:775
#define PNANOVDB_LOWER_OFF_BBOX_MIN
Definition: PNanoVDB.h:1066
Definition: PNanoVDB.h:961
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanodvb_grid_get_gridblindmetadata_value_address(pnanovdb_buf_t buf, pnanovdb_grid_handle_t grid, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1191
pnanovdb_address_t address
Definition: PNanoVDB.h:1019
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_lower_get_ave_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t node)
Definition: PNanoVDB.h:1372
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_readaccessor_get_value_address_and_level(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_uint32_t) level)
Definition: PNanoVDB.h:1767
#define PNANOVDB_LEAF_TABLE_NEG_OFF_MINIMUM
Definition: PNanoVDB.h:1110
#define PNANOVDB_GRID_OFF_VERSION
Definition: PNanoVDB.h:765
pnanovdb_uint32_t leaf_off_table
Definition: PNanoVDB.h:1152
pnanovdb_coord_t bbox_min
Definition: PNanoVDB.h:1010
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_root_tile_get_state(pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t p)
Definition: PNanoVDB.h:1004
pnanovdb_uint32_t root_off_background
Definition: PNanoVDB.h:1126
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_lower_get_bbox_min(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p)
Definition: PNanoVDB.h:1072
PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_read_int32(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:576
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_version(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:785
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_upper_get_max_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t node)
Definition: PNanoVDB.h:1440
Definition: PNanoVDB.h:758
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_leaf_is_active_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1897
ValueT value
Definition: GridBuilder.h:1287
Definition: PNanoVDB.h:699
PNANOVDB_FORCE_INLINE float pnanovdb_root_fp8_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
Definition: PNanoVDB.h:1580
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_node_count_upper(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:936
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_upper_get_value_mask(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p, pnanovdb_uint32_t bit_index)
Definition: PNanoVDB.h:1040
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_get_min_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root)
Definition: PNanoVDB.h:1500
pnanovdb_uint32_t upper_off_stddev
Definition: PNanoVDB.h:1139
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_upper_get_ave_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t node)
Definition: PNanoVDB.h:1446
#define PNANOVDB_ROOT_TILE_OFF_CHILD
Definition: PNanoVDB.h:995
pnanovdb_uint32_t root_tile_off_value
Definition: PNanoVDB.h:1134
PNANOVDB_FORCE_INLINE double pnanovdb_grid_get_voxel_size(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:811
#define PNANOVDB_LEAF_OFF_VALUE_MASK
Definition: PNanoVDB.h:1107
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_gridblindmetadata_get_element_count(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:867
#define PNANOVDB_GRID_OFF_BLIND_METADATA_OFFSET
Definition: PNanoVDB.h:776
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_node_offset_root(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:927
pnanovdb_uint32_t tile_count_upper
Definition: PNanoVDB.h:897
Definition: PNanoVDB.h:1008
PNANOVDB_FORCE_INLINE float pnanovdb_leaf_fp16_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1340
pnanovdb_uint64_t node_offset_leaf
Definition: PNanoVDB.h:888
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_get_value_address_bit(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_uint32_t) bit_index)
Definition: PNanoVDB.h:1558
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_upper_get_table_child(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t node, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:1464
pnanovdb_uint32_t tile_count_leaf
Definition: PNanoVDB.h:895
#define PNANOVDB_MAP_OFF_VECD
Definition: PNanoVDB.h:710
#define PNANOVDB_ROOT_OFF_TABLE_SIZE
Definition: PNanoVDB.h:968
pnanovdb_uint64_t node_offset_root
Definition: PNanoVDB.h:891
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_leaf_get_value_mask(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t p, pnanovdb_uint32_t bit_index)
Definition: PNanoVDB.h:1119
#define PNANOVDB_TREE_OFF_NODE_COUNT_LOWER
Definition: PNanoVDB.h:911
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_gridblindmetadata_get_data_class(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:876
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_upper_get_value_address_and_level(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t upper, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_uint32_t) level)
Definition: PNanoVDB.h:1477
Definition: PNanoVDB.h:1019
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_root_get_bbox_min(pnanovdb_buf_t buf, pnanovdb_root_handle_t p)
Definition: PNanoVDB.h:970
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_get_value_address_and_level_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_INOUT(pnanovdb_uint32_t) level)
Definition: PNanoVDB.h:1737
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_root_is_active_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1939
pnanovdb_uint32_t upper_off_ave
Definition: PNanoVDB.h:1138
#define PNANOVDB_LEAF_TABLE_NEG_OFF_QUANTUM
Definition: PNanoVDB.h:1111
pnanovdb_uint32_t root_off_min
Definition: PNanoVDB.h:1127
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_leaf_type[19]
Definition: PNanoVDB.h:685
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_upper_coord_to_offset(PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1427
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_upper_get_table_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t node, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:1458
pnanovdb_coord_t bbox_min
Definition: PNanoVDB.h:954
#define PNANOVDB_TREE_OFF_NODE_COUNT_UPPER
Definition: PNanoVDB.h:912
PNANOVDB_FORCE_INLINE float pnanovdb_map_get_taperf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:722
pnanovdb_address_t address
Definition: PNanoVDB.h:1099
#define PNANOVDB_GRID_OFF_GRID_CLASS
Definition: PNanoVDB.h:774
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_gridblindmetadata_get_name(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:882
#define PNANOVDB_MAP_OFF_MATD
Definition: PNanoVDB.h:708
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_grid_index_to_world_dirf(pnanovdb_buf_t buf, pnanovdb_grid_handle_t grid, PNANOVDB_IN(pnanovdb_vec3_t) src)
Definition: PNanoVDB.h:2054
#define PNANOVDB_GRID_OFF_GRID_NAME
Definition: PNanoVDB.h:770
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_blind_metadata_count(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:823
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_gridblindmetadata_get_semantic(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:873
PNANOVDB_FORCE_INLINE float pnanovdb_map_get_invmatf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:716
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_lower_get_value_mask(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p, pnanovdb_uint32_t bit_index)
Definition: PNanoVDB.h:1081
pnanovdb_uint32_t leaf_off_stddev
Definition: PNanoVDB.h:1151
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_root_tile_get_child(pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t p)
Definition: PNanoVDB.h:1001
pnanovdb_uint32_t tile_count_lower
Definition: PNanoVDB.h:896
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_leaf_get_min_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_leaf_handle_t node)
Definition: PNanoVDB.h:1278
#define PNANOVDB_GRID_OFF_MAP
Definition: PNanoVDB.h:771
PNANOVDB_FORCE_INLINE double pnanovdb_read_double(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:588
#define PNANOVDB_TREE_OFF_NODE_OFFSET_UPPER
Definition: PNanoVDB.h:908
pnanovdb_coord_t bbox_max
Definition: PNanoVDB.h:955
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_get_value_address_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1761
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_grid_get_grid_size(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:797
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_get_value_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1552
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_leaf_get_bbox_dif_and_flags(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t p)
Definition: PNanoVDB.h:1116
Definition: PNanoVDB.h:687
pnanovdb_uint64_t magic
Definition: PNanoVDB.h:740
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_leaf_get_stddev_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_leaf_handle_t node)
Definition: PNanoVDB.h:1296
pnanovdb_uint32_t node_count_upper
Definition: PNanoVDB.h:894
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_root_get_tile_count(pnanovdb_buf_t buf, pnanovdb_root_handle_t p)
Definition: PNanoVDB.h:976
pnanovdb_uint32_t lower_off_stddev
Definition: PNanoVDB.h:1145
#define PNANOVDB_GRID_OFF_CHECKSUM
Definition: PNanoVDB.h:764
PNANOVDB_FORCE_INLINE float pnanovdb_leaf_fpn_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1345
Definition: PNanoVDB.h:1049
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_node_offset_lower(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:921
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_grid_type(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:817
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_lower_get_dim_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t lower, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1813
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_lower_get_value_address_and_level_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t lower, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_INOUT(pnanovdb_uint32_t) level)
Definition: PNanoVDB.h:1686
pnanovdb_uint64_t flags
Definition: PNanoVDB.h:1012
PNANOVDB_FORCE_INLINE pnanovdb_map_handle_t pnanovdb_grid_get_map(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:803
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_lower_get_max_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t node)
Definition: PNanoVDB.h:1366
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_lower_get_table_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t node, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:1384
PNANOVDB_STATIC_CONST float pnanovdb_dither_lut[512]
Definition: PNanoVDB.h:2143
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_upper_get_dim_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t upper, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1831
PNANOVDB_FORCE_INLINE void pnanovdb_readaccessor_init(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, pnanovdb_root_handle_t root)
Definition: PNanoVDB.h:1634
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_grid_index_to_worldf(pnanovdb_buf_t buf, pnanovdb_grid_handle_t grid, PNANOVDB_IN(pnanovdb_vec3_t) src)
Definition: PNanoVDB.h:2042
pnanovdb_uint32_t pad1
Definition: PNanoVDB.h:957
PNANOVDB_FORCE_INLINE pnanovdb_upper_handle_t pnanovdb_root_get_child(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root, pnanovdb_root_tile_handle_t tile)
Definition: PNanoVDB.h:1230
pnanovdb_uint64_t node_offset_upper
Definition: PNanoVDB.h:890
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_lower_coord_to_offset(PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1353
#define PNANOVDB_GRIDBLINDMETADATA_OFF_SEMANTIC
Definition: PNanoVDB.h:859
#define PNANOVDB_TREE_OFF_VOXEL_COUNT
Definition: PNanoVDB.h:916
pnanovdb_coord_t bbox_max
Definition: PNanoVDB.h:1011
#define PNANOVDB_GRID_OFF_GRID_SIZE
Definition: PNanoVDB.h:769
PNANOVDB_FORCE_INLINE double pnanovdb_map_get_matd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:725
Definition: PNanoVDB.h:989
PNANOVDB_FORCE_INLINE pnanovdb_root_tile_handle_t pnanovdb_root_get_tile_zero(pnanovdb_grid_type_t grid_type, pnanovdb_root_handle_t root)
Definition: PNanoVDB.h:1223
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_stat_strides_bits[19]
Definition: PNanoVDB.h:684
pnanovdb_uint32_t flags
Definition: PNanoVDB.h:743
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_leaf_get_value_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1308
pnanovdb_uint32_t grid_class
Definition: PNanoVDB.h:751
Definition: PNanoVDB.h:1624
#define PNANOVDB_GRID_OFF_GRID_INDEX
Definition: PNanoVDB.h:767
#define PNANOVDB_TREE_OFF_NODE_OFFSET_LEAF
Definition: PNanoVDB.h:906
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_flags(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:788
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_leaf_get_ave_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_leaf_handle_t node)
Definition: PNanoVDB.h:1290
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_map_apply(pnanovdb_buf_t buf, pnanovdb_map_handle_t map, PNANOVDB_IN(pnanovdb_vec3_t) src)
Definition: PNanoVDB.h:1988
#define PNANOVDB_GRID_OFF_BLIND_METADATA_COUNT
Definition: PNanoVDB.h:777
#define PNANOVDB_MAP_OFF_TAPERD
Definition: PNanoVDB.h:711
#define PNANOVDB_GRID_OFF_WORLD_BBOX
Definition: PNanoVDB.h:772
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_get_value_address_and_level(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_uint32_t) level)
Definition: PNanoVDB.h:1530
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_minmax_strides_bits[19]
Definition: PNanoVDB.h:682
pnanovdb_uint64_t key
Definition: PNanoVDB.h:982
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_map_apply_inverse_jacobi(pnanovdb_buf_t buf, pnanovdb_map_handle_t map, PNANOVDB_IN(pnanovdb_vec3_t) src)
Definition: PNanoVDB.h:2024
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_read_int64(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:584
PNANOVDB_FORCE_INLINE pnanovdb_root_tile_handle_t pnanovdb_root_find_tile(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_handle_t root, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1254
pnanovdb_uint32_t leaf_off_ave
Definition: PNanoVDB.h:1150
PNANOVDB_FORCE_INLINE float pnanovdb_map_get_vecf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:719
pnanovdb_uint32_t root_off_ave
Definition: PNanoVDB.h:1129
pnanovdb_uint32_t lower_size
Definition: PNanoVDB.h:1147
pnanovdb_int64_t child
Definition: PNanoVDB.h:983
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_version_get_patch(pnanovdb_uint32_t version)
Definition: PNanoVDB.h:835
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_leaf_coord_to_offset(PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1271
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_lower_get_min_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t node)
Definition: PNanoVDB.h:1360
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_grid_class(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:814
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_coord_to_key(PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1237
#define PNANOVDB_MAP_OFF_INVMATF
Definition: PNanoVDB.h:705
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_lower_get_value_address_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t lower, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1706
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_read_bit(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_uint32_t bit_offset)
Definition: PNanoVDB.h:601
pnanovdb_uint32_t state
Definition: PNanoVDB.h:984
double taperd
Definition: PNanoVDB.h:696
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_leaf_get_value_address_and_cache(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, PNANOVDB_IN(pnanovdb_coord_t) ijk, PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc)
Definition: PNanoVDB.h:1680
pnanovdb_root_handle_t root
Definition: PNanoVDB.h:1630
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_root_tile_get_value_address(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t root_tile)
Definition: PNanoVDB.h:1524
PNANOVDB_FORCE_INLINE float pnanovdb_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:580
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_grid_world_to_indexf(pnanovdb_buf_t buf, pnanovdb_grid_handle_t grid, PNANOVDB_IN(pnanovdb_vec3_t) src)
Definition: PNanoVDB.h:2036
pnanovdb_address_t address
Definition: PNanoVDB.h:901