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) 59 #ifndef __CUDACC_RTC__ 66 #if defined(PNANOVDB_BUF_CUSTOM) 68 #elif defined(PNANOVDB_C) 69 #define PNANOVDB_BUF_C 70 #elif defined(PNANOVDB_HLSL) 71 #define PNANOVDB_BUF_HLSL 72 #elif defined(PNANOVDB_GLSL) 73 #define PNANOVDB_BUF_GLSL 76 #if defined(PNANOVDB_BUF_C) 77 #ifndef __CUDACC_RTC__ 80 #if defined(__CUDACC__) 81 #define PNANOVDB_BUF_FORCE_INLINE static __host__ __device__ __forceinline__ 83 #define PNANOVDB_BUF_FORCE_INLINE static inline __forceinline 85 #define PNANOVDB_BUF_FORCE_INLINE static inline __attribute__((always_inline)) 87 typedef struct pnanovdb_buf_t
90 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 91 uint64_t size_in_words;
94 PNANOVDB_BUF_FORCE_INLINE pnanovdb_buf_t pnanovdb_make_buf(uint32_t* data, uint64_t size_in_words)
98 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 99 ret.size_in_words = size_in_words;
103 #if defined(PNANOVDB_ADDRESS_32) 104 PNANOVDB_BUF_FORCE_INLINE uint32_t pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint32_t byte_offset)
106 uint32_t wordaddress = (byte_offset >> 2u);
107 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 108 return wordaddress < buf.size_in_words ? buf.data[wordaddress] : 0u;
110 return buf.data[wordaddress];
113 PNANOVDB_BUF_FORCE_INLINE uint64_t pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint32_t byte_offset)
115 uint64_t* data64 = (uint64_t*)buf.data;
116 uint32_t wordaddress64 = (byte_offset >> 3u);
117 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 118 uint64_t size_in_words64 = buf.size_in_words >> 1u;
119 return wordaddress64 < size_in_words64 ? data64[wordaddress64] : 0llu;
121 return data64[wordaddress64];
124 PNANOVDB_BUF_FORCE_INLINE
void pnanovdb_buf_write_uint32(pnanovdb_buf_t buf, uint32_t byte_offset, uint32_t value)
126 uint32_t wordaddress = (byte_offset >> 2u);
127 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 128 if (wordaddress < buf.size_in_words)
130 buf.data[wordaddress] = value;
133 buf.data[wordaddress] = value;
136 PNANOVDB_BUF_FORCE_INLINE
void pnanovdb_buf_write_uint64(pnanovdb_buf_t buf, uint32_t byte_offset, uint64_t value)
138 uint64_t* data64 = (uint64_t*)buf.data;
139 uint32_t wordaddress64 = (byte_offset >> 3u);
140 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 141 uint64_t size_in_words64 = buf.size_in_words >> 1u;
142 if (wordaddress64 < size_in_words64)
144 data64[wordaddress64] = value;
147 data64[wordaddress64] = value;
150 #elif defined(PNANOVDB_ADDRESS_64) 151 PNANOVDB_BUF_FORCE_INLINE uint32_t pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint64_t byte_offset)
153 uint64_t wordaddress = (byte_offset >> 2u);
154 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 155 return wordaddress < buf.size_in_words ? buf.data[wordaddress] : 0u;
157 return buf.data[wordaddress];
160 PNANOVDB_BUF_FORCE_INLINE uint64_t pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint64_t byte_offset)
162 uint64_t* data64 = (uint64_t*)buf.data;
163 uint64_t wordaddress64 = (byte_offset >> 3u);
164 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 165 uint64_t size_in_words64 = buf.size_in_words >> 1u;
166 return wordaddress64 < size_in_words64 ? data64[wordaddress64] : 0llu;
168 return data64[wordaddress64];
171 PNANOVDB_BUF_FORCE_INLINE
void pnanovdb_buf_write_uint32(pnanovdb_buf_t buf, uint64_t byte_offset, uint32_t value)
173 uint64_t wordaddress = (byte_offset >> 2u);
174 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 175 if (wordaddress < buf.size_in_words)
177 buf.data[wordaddress] = value;
180 buf.data[wordaddress] = value;
183 PNANOVDB_BUF_FORCE_INLINE
void pnanovdb_buf_write_uint64(pnanovdb_buf_t buf, uint64_t byte_offset, uint64_t value)
185 uint64_t* data64 = (uint64_t*)buf.data;
186 uint64_t wordaddress64 = (byte_offset >> 3u);
187 #ifdef PNANOVDB_BUF_BOUNDS_CHECK 188 uint64_t size_in_words64 = buf.size_in_words >> 1u;
189 if (wordaddress64 < size_in_words64)
191 data64[wordaddress64] = value;
194 data64[wordaddress64] = value;
198 typedef uint32_t pnanovdb_grid_type_t;
199 #define PNANOVDB_GRID_TYPE_GET(grid_typeIn, nameIn) pnanovdb_grid_type_constants[grid_typeIn].nameIn 200 #elif defined(PNANOVDB_BUF_HLSL) 201 #if defined(PNANOVDB_ADDRESS_32) 202 #define pnanovdb_buf_t StructuredBuffer<uint> 203 uint pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint byte_offset)
205 return buf[(byte_offset >> 2u)];
207 uint2 pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint byte_offset)
210 ret.x = pnanovdb_buf_read_uint32(buf, byte_offset + 0u);
211 ret.y = pnanovdb_buf_read_uint32(buf, byte_offset + 4u);
214 void pnanovdb_buf_write_uint32(pnanovdb_buf_t buf, uint byte_offset, uint value)
218 void pnanovdb_buf_write_uint64(pnanovdb_buf_t buf, uint byte_offset, uint2 value)
222 #elif defined(PNANOVDB_ADDRESS_64) 223 #define pnanovdb_buf_t StructuredBuffer<uint> 224 uint pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint64_t byte_offset)
226 return buf[uint(byte_offset >> 2u)];
228 uint64_t pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint64_t byte_offset)
231 ret = pnanovdb_buf_read_uint32(buf, byte_offset + 0u);
232 ret = ret + (uint64_t(pnanovdb_buf_read_uint32(buf, byte_offset + 4u)) << 32u);
235 void pnanovdb_buf_write_uint32(pnanovdb_buf_t buf, uint64_t byte_offset, uint value)
239 void pnanovdb_buf_write_uint64(pnanovdb_buf_t buf, uint64_t byte_offset, uint64_t value)
244 #define pnanovdb_grid_type_t uint 245 #define PNANOVDB_GRID_TYPE_GET(grid_typeIn, nameIn) pnanovdb_grid_type_constants[grid_typeIn].nameIn 246 #elif defined(PNANOVDB_BUF_GLSL) 247 struct pnanovdb_buf_t
251 uint pnanovdb_buf_read_uint32(pnanovdb_buf_t buf, uint byte_offset)
253 return pnanovdb_buf_data[(byte_offset >> 2u)];
255 uvec2 pnanovdb_buf_read_uint64(pnanovdb_buf_t buf, uint byte_offset)
258 ret.x = pnanovdb_buf_read_uint32(buf, byte_offset + 0u);
259 ret.y = pnanovdb_buf_read_uint32(buf, byte_offset + 4u);
262 void pnanovdb_buf_write_uint32(pnanovdb_buf_t buf, uint byte_offset, uint value)
266 void pnanovdb_buf_write_uint64(pnanovdb_buf_t buf, uint byte_offset, uvec2 value)
270 #define pnanovdb_grid_type_t uint 271 #define PNANOVDB_GRID_TYPE_GET(grid_typeIn, nameIn) pnanovdb_grid_type_constants[grid_typeIn].nameIn 277 #if defined(PNANOVDB_C) 278 #if defined(__CUDACC__) 279 #define PNANOVDB_FORCE_INLINE static __host__ __device__ __forceinline__ 280 #elif defined(_WIN32) 281 #define PNANOVDB_FORCE_INLINE static inline __forceinline 283 #define PNANOVDB_FORCE_INLINE static inline __attribute__((always_inline)) 285 #elif defined(PNANOVDB_HLSL) 286 #define PNANOVDB_FORCE_INLINE 287 #elif defined(PNANOVDB_GLSL) 288 #define PNANOVDB_FORCE_INLINE 292 #if defined(PNANOVDB_C) 293 #define PNANOVDB_STRUCT_TYPEDEF(X) typedef struct X X; 294 #if defined(__CUDA_ARCH__) 295 #define PNANOVDB_STATIC_CONST constexpr __constant__ 297 #define PNANOVDB_STATIC_CONST static const 299 #define PNANOVDB_INOUT(X) X* 300 #define PNANOVDB_IN(X) const X* 301 #define PNANOVDB_DEREF(X) (*X) 302 #define PNANOVDB_REF(X) &X 303 #elif defined(PNANOVDB_HLSL) 304 #define PNANOVDB_STRUCT_TYPEDEF(X) 305 #define PNANOVDB_STATIC_CONST static const 306 #define PNANOVDB_INOUT(X) inout X 307 #define PNANOVDB_IN(X) X 308 #define PNANOVDB_DEREF(X) X 309 #define PNANOVDB_REF(X) X 310 #elif defined(PNANOVDB_GLSL) 311 #define PNANOVDB_STRUCT_TYPEDEF(X) 312 #define PNANOVDB_STATIC_CONST const 313 #define PNANOVDB_INOUT(X) inout X 314 #define PNANOVDB_IN(X) X 315 #define PNANOVDB_DEREF(X) X 316 #define PNANOVDB_REF(X) X 320 #if defined(PNANOVDB_C) 321 #define PNANOVDB_NATIVE_64 322 #ifndef __CUDACC_RTC__ 325 #if !defined(PNANOVDB_MEMCPY_CUSTOM) 326 #ifndef __CUDACC_RTC__ 329 #define pnanovdb_memcpy memcpy 331 typedef uint32_t pnanovdb_uint32_t;
332 typedef int32_t pnanovdb_int32_t;
333 typedef int32_t pnanovdb_bool_t;
334 #define PNANOVDB_FALSE 0 335 #define PNANOVDB_TRUE 1 336 typedef uint64_t pnanovdb_uint64_t;
337 typedef int64_t pnanovdb_int64_t;
338 typedef struct pnanovdb_coord_t
340 pnanovdb_int32_t x, y, z;
342 typedef struct pnanovdb_vec3_t
346 PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_uint32_as_int32(pnanovdb_uint32_t v) {
return (pnanovdb_int32_t)v; }
347 PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_uint64_as_int64(pnanovdb_uint64_t v) {
return (pnanovdb_int64_t)v; }
348 PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_int64_as_uint64(pnanovdb_int64_t v) {
return (pnanovdb_uint64_t)v; }
349 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_int32_as_uint32(pnanovdb_int32_t v) {
return (pnanovdb_uint32_t)v; }
350 PNANOVDB_FORCE_INLINE
float pnanovdb_uint32_as_float(pnanovdb_uint32_t v) {
float vf; pnanovdb_memcpy(&vf, &v,
sizeof(vf));
return vf; }
351 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_float_as_uint32(
float v) {
return *((pnanovdb_uint32_t*)(&v)); }
352 PNANOVDB_FORCE_INLINE
double pnanovdb_uint64_as_double(pnanovdb_uint64_t v) {
double vf; pnanovdb_memcpy(&vf, &v,
sizeof(vf));
return vf; }
353 PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_double_as_uint64(
double v) {
return *((pnanovdb_uint64_t*)(&v)); }
354 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_uint64_low(pnanovdb_uint64_t v) {
return (pnanovdb_uint32_t)v; }
355 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_uint64_high(pnanovdb_uint64_t v) {
return (pnanovdb_uint32_t)(v >> 32u); }
356 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); }
357 PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_uint32_as_uint64_low(pnanovdb_uint32_t x) {
return ((pnanovdb_uint64_t)x); }
358 PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_uint64_is_equal(pnanovdb_uint64_t a, pnanovdb_uint64_t b) {
return a == b; }
359 PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_int64_is_zero(pnanovdb_int64_t a) {
return a == 0; }
360 #ifdef PNANOVDB_CMATH 361 PNANOVDB_FORCE_INLINE
float pnanovdb_floor(
float v) {
return floorf(v); }
363 PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_float_to_int32(
float v) {
return (pnanovdb_int32_t)v; }
364 PNANOVDB_FORCE_INLINE
float pnanovdb_int32_to_float(pnanovdb_int32_t v) {
return (
float)v; }
365 PNANOVDB_FORCE_INLINE
float pnanovdb_uint32_to_float(pnanovdb_uint32_t v) {
return (
float)v; }
366 PNANOVDB_FORCE_INLINE
float pnanovdb_min(
float a,
float b) {
return a < b ? a : b; }
367 PNANOVDB_FORCE_INLINE
float pnanovdb_max(
float a,
float b) {
return a > b ? a : b; }
368 #elif defined(PNANOVDB_HLSL) 369 typedef uint pnanovdb_uint32_t;
370 typedef int pnanovdb_int32_t;
371 typedef bool pnanovdb_bool_t;
372 #define PNANOVDB_FALSE false 373 #define PNANOVDB_TRUE true 374 typedef int3 pnanovdb_coord_t;
375 typedef float3 pnanovdb_vec3_t;
376 pnanovdb_int32_t pnanovdb_uint32_as_int32(pnanovdb_uint32_t v) {
return int(v); }
377 pnanovdb_uint32_t pnanovdb_int32_as_uint32(pnanovdb_int32_t v) {
return uint(v); }
378 float pnanovdb_uint32_as_float(pnanovdb_uint32_t v) {
return asfloat(v); }
379 pnanovdb_uint32_t pnanovdb_float_as_uint32(
float v) {
return asuint(v); }
380 float pnanovdb_floor(
float v) {
return floor(v); }
381 pnanovdb_int32_t pnanovdb_float_to_int32(
float v) {
return int(v); }
382 float pnanovdb_int32_to_float(pnanovdb_int32_t v) {
return float(v); }
383 float pnanovdb_uint32_to_float(pnanovdb_uint32_t v) {
return float(v); }
384 float pnanovdb_min(
float a,
float b) {
return min(a, b); }
385 float pnanovdb_max(
float a,
float b) {
return max(a, b); }
386 #if defined(PNANOVDB_ADDRESS_32) 387 typedef uint2 pnanovdb_uint64_t;
388 typedef int2 pnanovdb_int64_t;
389 pnanovdb_int64_t pnanovdb_uint64_as_int64(pnanovdb_uint64_t v) {
return int2(v); }
390 pnanovdb_uint64_t pnanovdb_int64_as_uint64(pnanovdb_int64_t v) {
return uint2(v); }
391 double pnanovdb_uint64_as_double(pnanovdb_uint64_t v) {
return asdouble(v.x, v.y); }
392 pnanovdb_uint64_t pnanovdb_double_as_uint64(
double v) { uint2 ret; asuint(v, ret.x, ret.y);
return ret; }
393 pnanovdb_uint32_t pnanovdb_uint64_low(pnanovdb_uint64_t v) {
return v.x; }
394 pnanovdb_uint32_t pnanovdb_uint64_high(pnanovdb_uint64_t v) {
return v.y; }
395 pnanovdb_uint64_t pnanovdb_uint32_as_uint64(pnanovdb_uint32_t x, pnanovdb_uint32_t y) {
return uint2(x, y); }
396 pnanovdb_uint64_t pnanovdb_uint32_as_uint64_low(pnanovdb_uint32_t x) {
return uint2(x, 0); }
397 bool pnanovdb_uint64_is_equal(pnanovdb_uint64_t a, pnanovdb_uint64_t b) {
return (a.x == b.x) && (a.y == b.y); }
398 bool pnanovdb_int64_is_zero(pnanovdb_int64_t a) {
return a.x == 0 && a.y == 0; }
400 typedef uint64_t pnanovdb_uint64_t;
401 typedef int64_t pnanovdb_int64_t;
402 pnanovdb_int64_t pnanovdb_uint64_as_int64(pnanovdb_uint64_t v) {
return int64_t(v); }
403 pnanovdb_uint64_t pnanovdb_int64_as_uint64(pnanovdb_int64_t v) {
return uint64_t(v); }
404 double pnanovdb_uint64_as_double(pnanovdb_uint64_t v) {
return asdouble(uint(v), uint(v >> 32u)); }
405 pnanovdb_uint64_t pnanovdb_double_as_uint64(
double v) { uint2 ret; asuint(v, ret.x, ret.y);
return uint64_t(ret.x) + (uint64_t(ret.y) << 32u); }
406 pnanovdb_uint32_t pnanovdb_uint64_low(pnanovdb_uint64_t v) {
return uint(v); }
407 pnanovdb_uint32_t pnanovdb_uint64_high(pnanovdb_uint64_t v) {
return uint(v >> 32u); }
408 pnanovdb_uint64_t pnanovdb_uint32_as_uint64(pnanovdb_uint32_t x, pnanovdb_uint32_t y) {
return uint64_t(x) + (uint64_t(y) << 32u); }
409 pnanovdb_uint64_t pnanovdb_uint32_as_uint64_low(pnanovdb_uint32_t x) {
return uint64_t(x); }
410 bool pnanovdb_uint64_is_equal(pnanovdb_uint64_t a, pnanovdb_uint64_t b) {
return a == b; }
411 bool pnanovdb_int64_is_zero(pnanovdb_int64_t a) {
return a == 0; }
413 #elif defined(PNANOVDB_GLSL) 414 #define pnanovdb_uint32_t uint 415 #define pnanovdb_int32_t int 416 #define pnanovdb_bool_t bool 417 #define PNANOVDB_FALSE false 418 #define PNANOVDB_TRUE true 419 #define pnanovdb_uint64_t uvec2 420 #define pnanovdb_int64_t ivec2 421 #define pnanovdb_coord_t ivec3 422 #define pnanovdb_vec3_t vec3 423 pnanovdb_int32_t pnanovdb_uint32_as_int32(pnanovdb_uint32_t v) {
return int(v); }
424 pnanovdb_int64_t pnanovdb_uint64_as_int64(pnanovdb_uint64_t v) {
return ivec2(v); }
425 pnanovdb_uint64_t pnanovdb_int64_as_uint64(pnanovdb_int64_t v) {
return uvec2(v); }
426 pnanovdb_uint32_t pnanovdb_int32_as_uint32(pnanovdb_int32_t v) {
return uint(v); }
427 float pnanovdb_uint32_as_float(pnanovdb_uint32_t v) {
return uintBitsToFloat(v); }
428 pnanovdb_uint32_t pnanovdb_float_as_uint32(
float v) {
return floatBitsToUint(v); }
429 double pnanovdb_uint64_as_double(pnanovdb_uint64_t v) {
return packDouble2x32(uvec2(v.x, v.y)); }
430 pnanovdb_uint64_t pnanovdb_double_as_uint64(
double v) {
return unpackDouble2x32(v); }
431 pnanovdb_uint32_t pnanovdb_uint64_low(pnanovdb_uint64_t v) {
return v.x; }
432 pnanovdb_uint32_t pnanovdb_uint64_high(pnanovdb_uint64_t v) {
return v.y; }
433 pnanovdb_uint64_t pnanovdb_uint32_as_uint64(pnanovdb_uint32_t x, pnanovdb_uint32_t y) {
return uvec2(x, y); }
434 pnanovdb_uint64_t pnanovdb_uint32_as_uint64_low(pnanovdb_uint32_t x) {
return uvec2(x, 0); }
435 bool pnanovdb_uint64_is_equal(pnanovdb_uint64_t a, pnanovdb_uint64_t b) {
return (a.x == b.x) && (a.y == b.y); }
436 bool pnanovdb_int64_is_zero(pnanovdb_int64_t a) {
return a.x == 0 && a.y == 0; }
437 float pnanovdb_floor(
float v) {
return floor(v); }
438 pnanovdb_int32_t pnanovdb_float_to_int32(
float v) {
return int(v); }
439 float pnanovdb_int32_to_float(pnanovdb_int32_t v) {
return float(v); }
440 float pnanovdb_uint32_to_float(pnanovdb_uint32_t v) {
return float(v); }
441 float pnanovdb_min(
float a,
float b) {
return min(a, b); }
442 float pnanovdb_max(
float a,
float b) {
return max(a, b); }
447 #if defined(PNANOVDB_C) 448 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_uniform(
float a)
456 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_add(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
464 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_sub(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
472 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_mul(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
480 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_div(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
488 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_min(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
491 v.x = a.x < b.x ? a.x : b.x;
492 v.y = a.y < b.y ? a.y : b.y;
493 v.z = a.z < b.z ? a.z : b.z;
496 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_vec3_max(
const pnanovdb_vec3_t a,
const pnanovdb_vec3_t b)
499 v.x = a.x > b.x ? a.x : b.x;
500 v.y = a.y > b.y ? a.y : b.y;
501 v.z = a.z > b.z ? a.z : b.z;
504 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_coord_to_vec3(
const pnanovdb_coord_t coord)
507 v.x = pnanovdb_int32_to_float(coord.x);
508 v.y = pnanovdb_int32_to_float(coord.y);
509 v.z = pnanovdb_int32_to_float(coord.z);
512 PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_coord_uniform(
const pnanovdb_int32_t a)
520 PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_coord_add(pnanovdb_coord_t a, pnanovdb_coord_t b)
528 #elif defined(PNANOVDB_HLSL) 529 pnanovdb_vec3_t pnanovdb_vec3_uniform(
float a) {
return float3(a, a, a); }
530 pnanovdb_vec3_t pnanovdb_vec3_add(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a + b; }
531 pnanovdb_vec3_t pnanovdb_vec3_sub(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a - b; }
532 pnanovdb_vec3_t pnanovdb_vec3_mul(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a * b; }
533 pnanovdb_vec3_t pnanovdb_vec3_div(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a / b; }
534 pnanovdb_vec3_t pnanovdb_vec3_min(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return min(a, b); }
535 pnanovdb_vec3_t pnanovdb_vec3_max(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return max(a, b); }
536 pnanovdb_vec3_t pnanovdb_coord_to_vec3(pnanovdb_coord_t coord) {
return float3(coord); }
537 pnanovdb_coord_t pnanovdb_coord_uniform(pnanovdb_int32_t a) {
return int3(a, a, a); }
538 pnanovdb_coord_t pnanovdb_coord_add(pnanovdb_coord_t a, pnanovdb_coord_t b) {
return a + b; }
539 #elif defined(PNANOVDB_GLSL) 540 pnanovdb_vec3_t pnanovdb_vec3_uniform(
float a) {
return vec3(a, a, a); }
541 pnanovdb_vec3_t pnanovdb_vec3_add(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a + b; }
542 pnanovdb_vec3_t pnanovdb_vec3_sub(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a - b; }
543 pnanovdb_vec3_t pnanovdb_vec3_mul(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a * b; }
544 pnanovdb_vec3_t pnanovdb_vec3_div(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return a / b; }
545 pnanovdb_vec3_t pnanovdb_vec3_min(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return min(a, b); }
546 pnanovdb_vec3_t pnanovdb_vec3_max(pnanovdb_vec3_t a, pnanovdb_vec3_t b) {
return max(a, b); }
547 pnanovdb_vec3_t pnanovdb_coord_to_vec3(
const pnanovdb_coord_t coord) {
return vec3(coord); }
548 pnanovdb_coord_t pnanovdb_coord_uniform(pnanovdb_int32_t a) {
return ivec3(a, a, a); }
549 pnanovdb_coord_t pnanovdb_coord_add(pnanovdb_coord_t a, pnanovdb_coord_t b) {
return a + b; }
556 #if defined(PNANOVDB_C) 557 #if defined(_MSC_VER) && (_MSC_VER >= 1928) && defined(PNANOVDB_USE_INTRINSICS) 558 return __popcnt(value);
559 #elif (defined(__GNUC__) || defined(__clang__)) && defined(PNANOVDB_USE_INTRINSICS) 560 return __builtin_popcount(value);
562 value = value - ((value >> 1) & 0x55555555);
563 value = (value & 0x33333333) + ((value >> 2) & 0x33333333);
564 value = (value + (value >> 4)) & 0x0F0F0F0F;
565 return (value * 0x01010101) >> 24;
567 #elif defined(PNANOVDB_HLSL) 568 return countbits(value);
569 #elif defined(PNANOVDB_GLSL) 570 return bitCount(value);
579 #if defined(PNANOVDB_ADDRESS_32) 582 pnanovdb_uint32_t low = pnanovdb_uint64_low(a);
583 pnanovdb_uint32_t high = pnanovdb_uint64_high(a);
589 return pnanovdb_uint32_as_uint64(low, high);
594 pnanovdb_uint32_t low = pnanovdb_uint64_low(a);
595 pnanovdb_uint32_t high = pnanovdb_uint64_high(a);
601 return pnanovdb_uint32_as_uint64(low, high);
606 pnanovdb_uint32_t low = pnanovdb_uint64_low(a);
607 pnanovdb_uint32_t high = pnanovdb_uint64_high(a);
610 ((low >> b) | ((b > 0) ? (high << (32u - b)) : 0u));
615 pnanovdb_uint32_t mask_low = bit_idx < 32u ? 1u << bit_idx : 0u;
616 pnanovdb_uint32_t mask_high = bit_idx >= 32u ? 1u << (bit_idx - 32u) : 0u;
617 return pnanovdb_uint32_as_uint64(mask_low, mask_high);
620 PNANOVDB_FORCE_INLINE pnanovdb_uint64_t
pnanovdb_uint64_and(pnanovdb_uint64_t a, pnanovdb_uint64_t b)
622 return pnanovdb_uint32_as_uint64(
623 pnanovdb_uint64_low(a) & pnanovdb_uint64_low(b),
624 pnanovdb_uint64_high(a) & pnanovdb_uint64_high(b)
630 return pnanovdb_uint64_low(a) != 0u || pnanovdb_uint64_high(a) != 0u;
646 return pnanovdb_uint64_low(a >> b);
651 return 1llu << bit_idx;
667 #if defined(PNANOVDB_ADDRESS_32) 668 struct pnanovdb_address_t
670 pnanovdb_uint32_t byte_offset;
672 PNANOVDB_STRUCT_TYPEDEF(pnanovdb_address_t)
674 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset)
676 pnanovdb_address_t ret = address;
677 ret.byte_offset += byte_offset;
680 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset_neg(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset)
682 pnanovdb_address_t ret = address;
683 ret.byte_offset -= byte_offset;
686 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset_product(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset, pnanovdb_uint32_t multiplier)
688 pnanovdb_address_t ret = address;
689 ret.byte_offset += byte_offset * multiplier;
692 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset64(pnanovdb_address_t address, pnanovdb_uint64_t byte_offset)
694 pnanovdb_address_t ret = address;
696 ret.byte_offset += pnanovdb_uint64_low(byte_offset);
699 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset64_product(pnanovdb_address_t address, pnanovdb_uint64_t byte_offset, pnanovdb_uint32_t multiplier)
701 pnanovdb_address_t ret = address;
702 ret.byte_offset += pnanovdb_uint64_low(byte_offset) * multiplier;
705 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_address_mask(pnanovdb_address_t address, pnanovdb_uint32_t mask)
707 return address.byte_offset & mask;
709 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_mask_inv(pnanovdb_address_t address, pnanovdb_uint32_t mask)
711 pnanovdb_address_t ret = address;
712 ret.byte_offset &= (~mask);
715 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_null()
717 pnanovdb_address_t ret = { 0 };
720 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_address_is_null(pnanovdb_address_t address)
722 return address.byte_offset == 0u;
724 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_address_in_interval(pnanovdb_address_t address, pnanovdb_address_t min_address, pnanovdb_address_t max_address)
726 return address.byte_offset >= min_address.byte_offset && address.byte_offset < max_address.byte_offset;
728 #elif defined(PNANOVDB_ADDRESS_64) 729 struct pnanovdb_address_t
731 pnanovdb_uint64_t byte_offset;
733 PNANOVDB_STRUCT_TYPEDEF(pnanovdb_address_t)
735 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset)
737 pnanovdb_address_t ret = address;
738 ret.byte_offset += byte_offset;
741 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset_neg(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset)
743 pnanovdb_address_t ret = address;
744 ret.byte_offset -= byte_offset;
747 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset_product(pnanovdb_address_t address, pnanovdb_uint32_t byte_offset, pnanovdb_uint32_t multiplier)
749 pnanovdb_address_t ret = address;
750 ret.byte_offset += pnanovdb_uint32_as_uint64_low(byte_offset) * pnanovdb_uint32_as_uint64_low(multiplier);
753 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset64(pnanovdb_address_t address, pnanovdb_uint64_t byte_offset)
755 pnanovdb_address_t ret = address;
756 ret.byte_offset += byte_offset;
759 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_offset64_product(pnanovdb_address_t address, pnanovdb_uint64_t byte_offset, pnanovdb_uint32_t multiplier)
761 pnanovdb_address_t ret = address;
762 ret.byte_offset += byte_offset * pnanovdb_uint32_as_uint64_low(multiplier);
765 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_address_mask(pnanovdb_address_t address, pnanovdb_uint32_t mask)
767 return pnanovdb_uint64_low(address.byte_offset) & mask;
769 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_mask_inv(pnanovdb_address_t address, pnanovdb_uint32_t mask)
771 pnanovdb_address_t ret = address;
772 ret.byte_offset &= (~pnanovdb_uint32_as_uint64_low(mask));
775 PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_address_null()
777 pnanovdb_address_t ret = { 0 };
780 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_address_is_null(pnanovdb_address_t address)
782 return address.byte_offset == 0llu;
784 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_address_in_interval(pnanovdb_address_t address, pnanovdb_address_t min_address, pnanovdb_address_t max_address)
786 return address.byte_offset >= min_address.byte_offset && address.byte_offset < max_address.byte_offset;
794 return pnanovdb_buf_read_uint32(buf, address.byte_offset);
798 return pnanovdb_buf_read_uint64(buf, address.byte_offset);
800 PNANOVDB_FORCE_INLINE pnanovdb_int32_t
pnanovdb_read_int32(pnanovdb_buf_t buf, pnanovdb_address_t address)
808 PNANOVDB_FORCE_INLINE pnanovdb_int64_t
pnanovdb_read_int64(pnanovdb_buf_t buf, pnanovdb_address_t address)
816 PNANOVDB_FORCE_INLINE pnanovdb_coord_t
pnanovdb_read_coord(pnanovdb_buf_t buf, pnanovdb_address_t address)
818 pnanovdb_coord_t ret;
819 ret.x = pnanovdb_uint32_as_int32(
pnanovdb_read_uint32(buf, pnanovdb_address_offset(address, 0u)));
820 ret.y = pnanovdb_uint32_as_int32(
pnanovdb_read_uint32(buf, pnanovdb_address_offset(address, 4u)));
821 ret.z = pnanovdb_uint32_as_int32(
pnanovdb_read_uint32(buf, pnanovdb_address_offset(address, 8u)));
824 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t
pnanovdb_read_vec3(pnanovdb_buf_t buf, pnanovdb_address_t address)
836 return (raw >> (pnanovdb_address_mask(address, 2) << 3));
838 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t
pnanovdb_read_uint8(pnanovdb_buf_t buf, pnanovdb_address_t address)
841 return (raw >> (pnanovdb_address_mask(address, 3) << 3)) & 255;
846 const float scale = 1.f / 65535.f;
847 ret.x = scale * pnanovdb_uint32_to_float(
pnanovdb_read_uint16(buf, pnanovdb_address_offset(address, 0u))) - 0.5f;
848 ret.y = scale * pnanovdb_uint32_to_float(
pnanovdb_read_uint16(buf, pnanovdb_address_offset(address, 2u))) - 0.5f;
849 ret.z = scale * pnanovdb_uint32_to_float(
pnanovdb_read_uint16(buf, pnanovdb_address_offset(address, 4u))) - 0.5f;
855 const float scale = 1.f / 255.f;
856 ret.x = scale * pnanovdb_uint32_to_float(
pnanovdb_read_uint8(buf, pnanovdb_address_offset(address, 0u))) - 0.5f;
857 ret.y = scale * pnanovdb_uint32_to_float(
pnanovdb_read_uint8(buf, pnanovdb_address_offset(address, 1u))) - 0.5f;
858 ret.z = scale * pnanovdb_uint32_to_float(
pnanovdb_read_uint8(buf, pnanovdb_address_offset(address, 2u))) - 0.5f;
862 PNANOVDB_FORCE_INLINE pnanovdb_bool_t
pnanovdb_read_bit(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_uint32_t bit_offset)
864 pnanovdb_address_t word_address = pnanovdb_address_mask_inv(address, 3u);
865 pnanovdb_uint32_t bit_index = (pnanovdb_address_mask(address, 3u) << 3u) + bit_offset;
866 pnanovdb_uint32_t value_word = pnanovdb_buf_read_uint32(buf, word_address.byte_offset);
867 return ((value_word >> bit_index) & 1) != 0u;
870 #if defined(PNANOVDB_C) 871 PNANOVDB_FORCE_INLINE
short pnanovdb_read_half(pnanovdb_buf_t buf, pnanovdb_address_t address)
874 return (
short)(raw >> (pnanovdb_address_mask(address, 2) << 3));
876 #elif defined(PNANOVDB_HLSL) 877 PNANOVDB_FORCE_INLINE
float pnanovdb_read_half(pnanovdb_buf_t buf, pnanovdb_address_t address)
880 return f16tof32(raw >> (pnanovdb_address_mask(address, 2) << 3));
882 #elif defined(PNANOVDB_GLSL) 883 PNANOVDB_FORCE_INLINE
float pnanovdb_read_half(pnanovdb_buf_t buf, pnanovdb_address_t address)
886 return unpackHalf2x16(raw >> (pnanovdb_address_mask(address, 2) << 3)).x;
892 PNANOVDB_FORCE_INLINE
void pnanovdb_write_uint32(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_uint32_t value)
894 pnanovdb_buf_write_uint32(buf, address.byte_offset, value);
896 PNANOVDB_FORCE_INLINE
void pnanovdb_write_uint64(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_uint64_t value)
898 pnanovdb_buf_write_uint64(buf, address.byte_offset, value);
900 PNANOVDB_FORCE_INLINE
void pnanovdb_write_int32(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_int32_t value)
904 PNANOVDB_FORCE_INLINE
void pnanovdb_write_int64(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_int64_t value)
906 pnanovdb_buf_write_uint64(buf, address.byte_offset, pnanovdb_int64_as_uint64(value));
916 PNANOVDB_FORCE_INLINE
void pnanovdb_write_coord(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) value)
918 pnanovdb_write_uint32(buf, pnanovdb_address_offset(address, 0u), pnanovdb_int32_as_uint32(PNANOVDB_DEREF(value).x));
919 pnanovdb_write_uint32(buf, pnanovdb_address_offset(address, 4u), pnanovdb_int32_as_uint32(PNANOVDB_DEREF(value).y));
920 pnanovdb_write_uint32(buf, pnanovdb_address_offset(address, 8u), pnanovdb_int32_as_uint32(PNANOVDB_DEREF(value).z));
922 PNANOVDB_FORCE_INLINE
void pnanovdb_write_vec3(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_vec3_t) value)
931 #define PNANOVDB_MAGIC_NUMBER 0x304244566f6e614eUL// "NanoVDB0" in hex - little endian (uint64_t) 932 #define PNANOVDB_MAGIC_GRID 0x314244566f6e614eUL// "NanoVDB1" in hex - little endian (uint64_t) 933 #define PNANOVDB_MAGIC_FILE 0x324244566f6e614eUL// "NanoVDB2" in hex - little endian (uint64_t) 935 #define PNANOVDB_MAJOR_VERSION_NUMBER 32// reflects changes to the ABI 936 #define PNANOVDB_MINOR_VERSION_NUMBER 7// reflects changes to the API but not ABI 937 #define PNANOVDB_PATCH_VERSION_NUMBER 0// reflects bug-fixes with no ABI or API changes 939 #define PNANOVDB_GRID_TYPE_UNKNOWN 0 940 #define PNANOVDB_GRID_TYPE_FLOAT 1 941 #define PNANOVDB_GRID_TYPE_DOUBLE 2 942 #define PNANOVDB_GRID_TYPE_INT16 3 943 #define PNANOVDB_GRID_TYPE_INT32 4 944 #define PNANOVDB_GRID_TYPE_INT64 5 945 #define PNANOVDB_GRID_TYPE_VEC3F 6 946 #define PNANOVDB_GRID_TYPE_VEC3D 7 947 #define PNANOVDB_GRID_TYPE_MASK 8 948 #define PNANOVDB_GRID_TYPE_HALF 9 949 #define PNANOVDB_GRID_TYPE_UINT32 10 950 #define PNANOVDB_GRID_TYPE_BOOLEAN 11 951 #define PNANOVDB_GRID_TYPE_RGBA8 12 952 #define PNANOVDB_GRID_TYPE_FP4 13 953 #define PNANOVDB_GRID_TYPE_FP8 14 954 #define PNANOVDB_GRID_TYPE_FP16 15 955 #define PNANOVDB_GRID_TYPE_FPN 16 956 #define PNANOVDB_GRID_TYPE_VEC4F 17 957 #define PNANOVDB_GRID_TYPE_VEC4D 18 958 #define PNANOVDB_GRID_TYPE_INDEX 19 959 #define PNANOVDB_GRID_TYPE_ONINDEX 20 960 #define PNANOVDB_GRID_TYPE_INDEXMASK 21 961 #define PNANOVDB_GRID_TYPE_ONINDEXMASK 22 962 #define PNANOVDB_GRID_TYPE_POINTINDEX 23 963 #define PNANOVDB_GRID_TYPE_VEC3U8 24 964 #define PNANOVDB_GRID_TYPE_VEC3U16 25 965 #define PNANOVDB_GRID_TYPE_UINT8 26 966 #define PNANOVDB_GRID_TYPE_END 27 968 #define PNANOVDB_GRID_CLASS_UNKNOWN 0 969 #define PNANOVDB_GRID_CLASS_LEVEL_SET 1 // narrow band level set, e.g. SDF 970 #define PNANOVDB_GRID_CLASS_FOG_VOLUME 2 // fog volume, e.g. density 971 #define PNANOVDB_GRID_CLASS_STAGGERED 3 // staggered MAC grid, e.g. velocity 972 #define PNANOVDB_GRID_CLASS_POINT_INDEX 4 // point index grid 973 #define PNANOVDB_GRID_CLASS_POINT_DATA 5 // point data grid 974 #define PNANOVDB_GRID_CLASS_TOPOLOGY 6 // grid with active states only (no values) 975 #define PNANOVDB_GRID_CLASS_VOXEL_VOLUME 7 // volume of geometric cubes, e.g. minecraft 976 #define PNANOVDB_GRID_CLASS_INDEX_GRID 8 // grid whose values are offsets, e.g. into an external array 977 #define PNANOVDB_GRID_CLASS_TENSOR_GRID 9 // grid which can have extra metadata and features 978 #define PNANOVDB_GRID_CLASS_END 10 980 #define PNANOVDB_GRID_FLAGS_HAS_LONG_GRID_NAME (1 << 0) 981 #define PNANOVDB_GRID_FLAGS_HAS_BBOX (1 << 1) 982 #define PNANOVDB_GRID_FLAGS_HAS_MIN_MAX (1 << 2) 983 #define PNANOVDB_GRID_FLAGS_HAS_AVERAGE (1 << 3) 984 #define PNANOVDB_GRID_FLAGS_HAS_STD_DEVIATION (1 << 4) 985 #define PNANOVDB_GRID_FLAGS_IS_BREADTH_FIRST (1 << 5) 986 #define PNANOVDB_GRID_FLAGS_END (1 << 6) 988 #define PNANOVDB_LEAF_TYPE_DEFAULT 0 989 #define PNANOVDB_LEAF_TYPE_LITE 1 990 #define PNANOVDB_LEAF_TYPE_FP 2 991 #define PNANOVDB_LEAF_TYPE_INDEX 3 992 #define PNANOVDB_LEAF_TYPE_INDEXMASK 4 993 #define PNANOVDB_LEAF_TYPE_POINTINDEX 5 997 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, 0, 0, 0, 0, 16, 24, 48, 8 };
999 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, 64, 64, 64, 64, 64, 64, 64, 64 };
1001 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, 64, 64, 64, 64, 64, 24, 48, 8 };
1003 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, 64, 64, 64, 64, 64, 8, 16, 8 };
1005 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, 64, 64, 64, 64, 64, 32, 32, 32 };
1007 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, 3, 3, 4, 4, 5, 0, 0, 0 };
1024 #define PNANOVDB_MAP_SIZE 264 1026 #define PNANOVDB_MAP_OFF_MATF 0 1027 #define PNANOVDB_MAP_OFF_INVMATF 36 1028 #define PNANOVDB_MAP_OFF_VECF 72 1029 #define PNANOVDB_MAP_OFF_TAPERF 84 1030 #define PNANOVDB_MAP_OFF_MATD 88 1031 #define PNANOVDB_MAP_OFF_INVMATD 160 1032 #define PNANOVDB_MAP_OFF_VECD 232 1033 #define PNANOVDB_MAP_OFF_TAPERD 256 1094 pnanovdb_uint32_t grid_name[256 / 4];
1096 double world_bbox[6];
1097 double voxel_size[3];
1102 pnanovdb_uint32_t pad[5];
1108 #define PNANOVDB_GRID_SIZE 672 1110 #define PNANOVDB_GRID_OFF_MAGIC 0 1111 #define PNANOVDB_GRID_OFF_CHECKSUM 8 1112 #define PNANOVDB_GRID_OFF_VERSION 16 1113 #define PNANOVDB_GRID_OFF_FLAGS 20 1114 #define PNANOVDB_GRID_OFF_GRID_INDEX 24 1115 #define PNANOVDB_GRID_OFF_GRID_COUNT 28 1116 #define PNANOVDB_GRID_OFF_GRID_SIZE 32 1117 #define PNANOVDB_GRID_OFF_GRID_NAME 40 1118 #define PNANOVDB_GRID_OFF_MAP 296 1119 #define PNANOVDB_GRID_OFF_WORLD_BBOX 560 1120 #define PNANOVDB_GRID_OFF_VOXEL_SIZE 608 1121 #define PNANOVDB_GRID_OFF_GRID_CLASS 632 1122 #define PNANOVDB_GRID_OFF_GRID_TYPE 636 1123 #define PNANOVDB_GRID_OFF_BLIND_METADATA_OFFSET 640 1124 #define PNANOVDB_GRID_OFF_BLIND_METADATA_COUNT 648 1217 PNANOVDB_FORCE_INLINE pnanovdb_uint32_t
pnanovdb_make_version(pnanovdb_uint32_t major, pnanovdb_uint32_t minor, pnanovdb_uint32_t patch_num)
1219 return (major << 21u) | (minor << 10u) | patch_num;
1224 return (version >> 21u) & ((1u << 11u) - 1u);
1228 return (version >> 10u) & ((1u << 11u) - 1u);
1232 return version & ((1u << 10u) - 1u);
1243 pnanovdb_uint32_t name[256 / 4];
1249 #define PNANOVDB_GRIDBLINDMETADATA_SIZE 288 1251 #define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_OFFSET 0 1252 #define PNANOVDB_GRIDBLINDMETADATA_OFF_VALUE_COUNT 8 1253 #define PNANOVDB_GRIDBLINDMETADATA_OFF_VALUE_SIZE 16 1254 #define PNANOVDB_GRIDBLINDMETADATA_OFF_SEMANTIC 20 1255 #define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_CLASS 24 1256 #define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_TYPE 28 1257 #define PNANOVDB_GRIDBLINDMETADATA_OFF_NAME 32 1299 #define PNANOVDB_TREE_SIZE 64 1301 #define PNANOVDB_TREE_OFF_NODE_OFFSET_LEAF 0 1302 #define PNANOVDB_TREE_OFF_NODE_OFFSET_LOWER 8 1303 #define PNANOVDB_TREE_OFF_NODE_OFFSET_UPPER 16 1304 #define PNANOVDB_TREE_OFF_NODE_OFFSET_ROOT 24 1305 #define PNANOVDB_TREE_OFF_NODE_COUNT_LEAF 32 1306 #define PNANOVDB_TREE_OFF_NODE_COUNT_LOWER 36 1307 #define PNANOVDB_TREE_OFF_NODE_COUNT_UPPER 40 1308 #define PNANOVDB_TREE_OFF_TILE_COUNT_LEAF 44 1309 #define PNANOVDB_TREE_OFF_TILE_COUNT_LOWER 48 1310 #define PNANOVDB_TREE_OFF_TILE_COUNT_UPPER 52 1311 #define PNANOVDB_TREE_OFF_VOXEL_COUNT 56 1393 #define PNANOVDB_ROOT_BASE_SIZE 28 1395 #define PNANOVDB_ROOT_OFF_BBOX_MIN 0 1396 #define PNANOVDB_ROOT_OFF_BBOX_MAX 12 1397 #define PNANOVDB_ROOT_OFF_TABLE_SIZE 24 1431 #define PNANOVDB_ROOT_TILE_BASE_SIZE 20 1433 #define PNANOVDB_ROOT_TILE_OFF_KEY 0 1434 #define PNANOVDB_ROOT_TILE_OFF_CHILD 8 1435 #define PNANOVDB_ROOT_TILE_OFF_STATE 16 1462 pnanovdb_uint32_t value_mask[1024];
1463 pnanovdb_uint32_t child_mask[1024];
1471 #define PNANOVDB_UPPER_TABLE_COUNT 32768 1472 #define PNANOVDB_UPPER_BASE_SIZE 8224 1474 #define PNANOVDB_UPPER_OFF_BBOX_MIN 0 1475 #define PNANOVDB_UPPER_OFF_BBOX_MAX 12 1476 #define PNANOVDB_UPPER_OFF_FLAGS 24 1477 #define PNANOVDB_UPPER_OFF_VALUE_MASK 32 1478 #define PNANOVDB_UPPER_OFF_CHILD_MASK 4128 1491 return ((value >> (bit_index & 31u)) & 1) != 0u;
1495 return ((value >> (bit_index & 31u)) & 1) != 0u;
1507 if (!value) { valueMask &= ~(1u << (bit_index & 31u)); }
1508 if (value) valueMask |= (1u << (bit_index & 31u));
1517 pnanovdb_uint32_t value_mask[128];
1518 pnanovdb_uint32_t child_mask[128];
1526 #define PNANOVDB_LOWER_TABLE_COUNT 4096 1527 #define PNANOVDB_LOWER_BASE_SIZE 1056 1529 #define PNANOVDB_LOWER_OFF_BBOX_MIN 0 1530 #define PNANOVDB_LOWER_OFF_BBOX_MAX 12 1531 #define PNANOVDB_LOWER_OFF_FLAGS 24 1532 #define PNANOVDB_LOWER_OFF_VALUE_MASK 32 1533 #define PNANOVDB_LOWER_OFF_CHILD_MASK 544 1546 return ((value >> (bit_index & 31u)) & 1) != 0u;
1550 return ((value >> (bit_index & 31u)) & 1) != 0u;
1562 if (!value) { valueMask &= ~(1u << (bit_index & 31u)); }
1563 if (value) valueMask |= (1u << (bit_index & 31u));
1571 pnanovdb_uint32_t value_mask[16];
1579 #define PNANOVDB_LEAF_TABLE_COUNT 512 1580 #define PNANOVDB_LEAF_BASE_SIZE 80 1582 #define PNANOVDB_LEAF_OFF_BBOX_MIN 0 1583 #define PNANOVDB_LEAF_OFF_BBOX_DIF_AND_FLAGS 12 1584 #define PNANOVDB_LEAF_OFF_VALUE_MASK 16 1586 #define PNANOVDB_LEAF_TABLE_NEG_OFF_BBOX_DIF_AND_FLAGS 84 1587 #define PNANOVDB_LEAF_TABLE_NEG_OFF_MINIMUM 16 1588 #define PNANOVDB_LEAF_TABLE_NEG_OFF_QUANTUM 12 1598 return ((value >> (bit_index & 31u)) & 1) != 0u;
1644 {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},
1645 {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},
1646 {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},
1647 {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},
1648 {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},
1649 {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},
1650 {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},
1651 {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},
1652 {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},
1653 {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},
1654 {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},
1655 {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},
1656 {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},
1657 {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},
1658 {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},
1659 {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},
1660 {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},
1661 {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},
1662 {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},
1663 {32, 40, 48, 56, 64, 96, 0, 8, 24, 32, 8224, 8232, 8240, 8248, 8256, 270400, 1056, 1064, 1072, 1080, 1088, 33856, 80, 80, 80, 80, 80, 96},
1664 {32, 40, 48, 56, 64, 96, 0, 8, 24, 32, 8224, 8232, 8240, 8248, 8256, 270400, 1056, 1064, 1072, 1080, 1088, 33856, 80, 80, 80, 80, 80, 96},
1665 {32, 40, 48, 56, 64, 96, 0, 8, 24, 32, 8224, 8232, 8240, 8248, 8256, 270400, 1056, 1064, 1072, 1080, 1088, 33856, 80, 80, 80, 80, 80, 160},
1666 {32, 40, 48, 56, 64, 96, 0, 8, 24, 32, 8224, 8232, 8240, 8248, 8256, 270400, 1056, 1064, 1072, 1080, 1088, 33856, 80, 80, 80, 80, 80, 160},
1667 {32, 40, 48, 56, 64, 96, 16, 8, 24, 32, 8224, 8232, 8240, 8248, 8256, 270400, 1056, 1064, 1072, 1080, 1088, 33856, 80, 88, 96, 96, 96, 1120},
1668 {28, 31, 34, 40, 44, 64, 24, 8, 20, 32, 8224, 8227, 8232, 8236, 8256, 270400, 1056, 1059, 1064, 1068, 1088, 33856, 80, 83, 88, 92, 96, 1632},
1669 {28, 34, 40, 48, 52, 64, 48, 8, 20, 32, 8224, 8230, 8236, 8240, 8256, 270400, 1056, 1062, 1068, 1072, 1088, 33856, 80, 86, 92, 96, 128, 3200},
1670 {28, 29, 30, 32, 36, 64, 8, 8, 20, 32, 8224, 8225, 8228, 8232, 8256, 270400, 1056, 1057, 1060, 1064, 1088, 33856, 80, 81, 84, 88, 96, 608},
1679 meta.
address = pnanovdb_address_offset64(meta.
address, byte_offset);
1688 pnanovdb_address_t address = pnanovdb_address_offset64(meta.
address, pnanovdb_int64_as_uint64(byte_offset));
1703 root.
address = pnanovdb_address_offset64(root.
address, byte_offset);
1710 tile.
address = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_size));
1711 tile.
address = pnanovdb_address_offset_product(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_size), n);
1718 tile.
address = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_size));
1731 #if defined(PNANOVDB_NATIVE_64) 1732 pnanovdb_uint64_t iu = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).x) >> 12u;
1733 pnanovdb_uint64_t ju = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).y) >> 12u;
1734 pnanovdb_uint64_t ku = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).z) >> 12u;
1735 return (ku) | (ju << 21u) | (iu << 42u);
1737 pnanovdb_uint32_t iu = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).x) >> 12u;
1738 pnanovdb_uint32_t ju = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).y) >> 12u;
1739 pnanovdb_uint32_t ku = pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).z) >> 12u;
1740 pnanovdb_uint32_t key_x = ku | (ju << 21);
1741 pnanovdb_uint32_t key_y = (iu << 10) | (ju >> 11);
1742 return pnanovdb_uint32_as_uint64(key_x, key_y);
1751 for (pnanovdb_uint32_t i = 0u; i < tile_count; i++)
1757 tile.
address = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_size));
1767 return (((PNANOVDB_DEREF(ijk).x & 7) >> 0) << (2 * 3)) +
1768 (((PNANOVDB_DEREF(ijk).y & 7) >> 0) << (3)) +
1769 ((PNANOVDB_DEREF(ijk).z & 7) >> 0);
1774 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, leaf_off_min);
1775 return pnanovdb_address_offset(node.
address, byte_offset);
1780 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, leaf_off_max);
1781 return pnanovdb_address_offset(node.
address, byte_offset);
1786 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, leaf_off_ave);
1787 return pnanovdb_address_offset(node.
address, byte_offset);
1792 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, leaf_off_stddev);
1793 return pnanovdb_address_offset(node.
address, byte_offset);
1798 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);
1799 return pnanovdb_address_offset(node.
address, byte_offset);
1810 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)
1813 pnanovdb_uint32_t value_bits = 1u << value_log_bits;
1814 pnanovdb_uint32_t value_mask = (1u << value_bits) - 1u;
1815 pnanovdb_uint32_t values_per_word_bits = 5u - value_log_bits;
1816 pnanovdb_uint32_t values_per_word_mask = (1u << values_per_word_bits) - 1u;
1821 pnanovdb_uint32_t raw =
pnanovdb_read_uint32(buf, pnanovdb_address_offset(address, ((n >> values_per_word_bits) << 2u)));
1822 pnanovdb_uint32_t value_compressed = (raw >> ((n & values_per_word_mask) << value_log_bits)) & value_mask;
1823 return pnanovdb_uint32_to_float(value_compressed) * quantum + minimum;
1844 pnanovdb_uint32_t flags = bbox_dif_and_flags >> 24u;
1845 pnanovdb_uint32_t value_log_bits = flags >> 5;
1911 pnanovdb_uint32_t word_idx = n >> 5;
1912 pnanovdb_uint32_t bit_idx = n & 31;
1913 pnanovdb_uint32_t val_mask =
1915 return (val_mask & (1u << bit_idx)) != 0u;
1919 pnanovdb_uint32_t word_idx = n >> 5;
1920 pnanovdb_uint32_t bit_idx = n & 31;
1921 pnanovdb_uint32_t val_mask =
1925 val_mask = val_mask | (1u << bit_idx);
1929 val_mask = val_mask & ~(1u << bit_idx);
1959 pnanovdb_uint64_t idx = pnanovdb_uint32_as_uint64_low(0u);
1970 pnanovdb_uint64_t idx = pnanovdb_uint32_as_uint64_low(0u);
1981 pnanovdb_uint64_t idx = pnanovdb_uint32_as_uint64_low(0u);
1992 pnanovdb_uint64_t idx = pnanovdb_uint32_as_uint64_low(0u);
2005 pnanovdb_uint32_t word_idx = n >> 6u;
2006 pnanovdb_uint32_t bit_idx = n & 63u;
2009 pnanovdb_uint64_t value_index = pnanovdb_uint32_as_uint64_low(0u);
2012 pnanovdb_uint32_t sum = 0u;
2016 pnanovdb_uint64_t prefix_sum =
pnanovdb_read_uint64(buf, pnanovdb_address_offset(value_address, 8u));
2061 pnanovdb_uint32_t word_idx = n >> 5;
2062 pnanovdb_uint32_t bit_idx = n & 31;
2063 pnanovdb_uint32_t val_mask =
2065 return (val_mask & (1u << bit_idx)) != 0u;
2069 pnanovdb_uint32_t word_idx = n >> 5;
2070 pnanovdb_uint32_t bit_idx = n & 31;
2071 pnanovdb_uint32_t val_mask =
2075 val_mask = val_mask | (1u << bit_idx);
2079 val_mask = val_mask & ~(1u << bit_idx);
2114 raw32 = (raw32 & 0xFFFF0000) | (value & 0x0000FFFF);
2118 raw32 = (raw32 & 0x0000FFFF) | (value << 16u);
2124 pnanovdb_uint32_t word_idx = i >> 5;
2125 pnanovdb_uint32_t bit_idx = i & 31;
2128 val_mask = val_mask | (1u << bit_idx);
2141 return (((PNANOVDB_DEREF(ijk).x & 127) >> 3) << (2 * 4)) +
2142 (((PNANOVDB_DEREF(ijk).y & 127) >> 3) << (4)) +
2143 ((PNANOVDB_DEREF(ijk).z & 127) >> 3);
2148 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_min);
2149 return pnanovdb_address_offset(node.
address, byte_offset);
2154 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_max);
2155 return pnanovdb_address_offset(node.
address, byte_offset);
2160 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_ave);
2161 return pnanovdb_address_offset(node.
address, byte_offset);
2166 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_stddev);
2167 return pnanovdb_address_offset(node.
address, byte_offset);
2172 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, lower_off_table) + PNANOVDB_GRID_TYPE_GET(grid_type, table_stride) * n;
2173 return pnanovdb_address_offset(node.
address, byte_offset);
2192 pnanovdb_address_t value_address;
2197 PNANOVDB_DEREF(level) = 0u;
2202 PNANOVDB_DEREF(level) = 1u;
2204 return value_address;
2209 pnanovdb_uint32_t level;
2217 return (((PNANOVDB_DEREF(ijk).x & 4095) >> 7) << (2 * 5)) +
2218 (((PNANOVDB_DEREF(ijk).y & 4095) >> 7) << (5)) +
2219 ((PNANOVDB_DEREF(ijk).z & 4095) >> 7);
2224 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_min);
2225 return pnanovdb_address_offset(node.
address, byte_offset);
2230 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_max);
2231 return pnanovdb_address_offset(node.
address, byte_offset);
2236 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_ave);
2237 return pnanovdb_address_offset(node.
address, byte_offset);
2242 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_stddev);
2243 return pnanovdb_address_offset(node.
address, byte_offset);
2248 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, upper_off_table) + PNANOVDB_GRID_TYPE_GET(grid_type, table_stride) * n;
2249 return pnanovdb_address_offset(node.
address, byte_offset);
2268 pnanovdb_address_t value_address;
2277 PNANOVDB_DEREF(level) = 2u;
2279 return value_address;
2284 pnanovdb_uint32_t level;
2298 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_off_min);
2299 return pnanovdb_address_offset(root.
address, byte_offset);
2304 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_off_max);
2305 return pnanovdb_address_offset(root.
address, byte_offset);
2310 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_off_ave);
2311 return pnanovdb_address_offset(root.
address, byte_offset);
2316 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_off_stddev);
2317 return pnanovdb_address_offset(root.
address, byte_offset);
2322 pnanovdb_uint32_t byte_offset = PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_off_value);
2323 return pnanovdb_address_offset(root_tile.
address, byte_offset);
2329 pnanovdb_address_t ret;
2330 if (pnanovdb_address_is_null(tile.
address))
2332 ret = pnanovdb_address_offset(root.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_off_background));
2333 PNANOVDB_DEREF(level) = 4u;
2337 ret = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_off_value));
2338 PNANOVDB_DEREF(level) = 3u;
2350 pnanovdb_uint32_t level;
2356 pnanovdb_uint32_t level;
2358 PNANOVDB_DEREF(bit_index) = level == 0u ? pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).x & 7) : 0u;
2362 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)
2376 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)
2390 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)
2404 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)
2420 pnanovdb_uint64_t ret;
2434 pnanovdb_uint64_t ret;
2448 pnanovdb_address_t value_address,
2449 PNANOVDB_IN(pnanovdb_coord_t) ijk,
2450 pnanovdb_uint32_t level,
2451 PNANOVDB_INOUT(pnanovdb_uint64_t)range_begin,
2452 PNANOVDB_INOUT(pnanovdb_uint64_t)range_end
2455 pnanovdb_uint32_t local_range_begin = 0u;
2456 pnanovdb_uint32_t local_range_end = 0u;
2457 pnanovdb_uint64_t offset = pnanovdb_uint32_as_uint64_low(0u);
2472 return pnanovdb_uint32_as_uint64_low(local_range_end - local_range_begin);
2477 pnanovdb_grid_type_t value_type,
2478 pnanovdb_address_t value_address,
2479 pnanovdb_address_t blindmetadata_value_address,
2480 PNANOVDB_IN(pnanovdb_coord_t) ijk,
2481 pnanovdb_uint32_t level,
2482 PNANOVDB_INOUT(pnanovdb_address_t)address_begin,
2483 PNANOVDB_INOUT(pnanovdb_address_t)address_end
2486 pnanovdb_uint64_t range_begin;
2487 pnanovdb_uint64_t range_end;
2490 pnanovdb_uint32_t stride = 12u;
2499 PNANOVDB_DEREF(address_begin) = pnanovdb_address_offset64_product(blindmetadata_value_address, range_begin, stride);
2500 PNANOVDB_DEREF(address_end) = pnanovdb_address_offset64_product(blindmetadata_value_address, range_end, stride);
2518 PNANOVDB_DEREF(acc).key.x = 0x7FFFFFFF;
2519 PNANOVDB_DEREF(acc).key.y = 0x7FFFFFFF;
2520 PNANOVDB_DEREF(acc).key.z = 0x7FFFFFFF;
2521 PNANOVDB_DEREF(acc).leaf.address = pnanovdb_address_null();
2522 PNANOVDB_DEREF(acc).lower.address = pnanovdb_address_null();
2523 PNANOVDB_DEREF(acc).upper.address = pnanovdb_address_null();
2524 PNANOVDB_DEREF(acc).root = root;
2529 if (pnanovdb_address_is_null(PNANOVDB_DEREF(acc).leaf.
address)) {
return PNANOVDB_FALSE; }
2530 if ((dirty & ~((1u << 3) - 1u)) != 0)
2532 PNANOVDB_DEREF(acc).leaf.address = pnanovdb_address_null();
2533 return PNANOVDB_FALSE;
2535 return PNANOVDB_TRUE;
2539 if (pnanovdb_address_is_null(PNANOVDB_DEREF(acc).lower.
address)) {
return PNANOVDB_FALSE; }
2540 if ((dirty & ~((1u << 7) - 1u)) != 0)
2542 PNANOVDB_DEREF(acc).lower.address = pnanovdb_address_null();
2543 return PNANOVDB_FALSE;
2545 return PNANOVDB_TRUE;
2549 if (pnanovdb_address_is_null(PNANOVDB_DEREF(acc).upper.
address)) {
return PNANOVDB_FALSE; }
2550 if ((dirty & ~((1u << 12) - 1u)) != 0)
2552 PNANOVDB_DEREF(acc).upper.address = pnanovdb_address_null();
2553 return PNANOVDB_FALSE;
2555 return PNANOVDB_TRUE;
2559 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);
2571 pnanovdb_address_t value_address;
2575 PNANOVDB_DEREF(acc).leaf = child;
2576 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
2578 PNANOVDB_DEREF(level) = 0u;
2583 PNANOVDB_DEREF(level) = 1u;
2585 return value_address;
2590 pnanovdb_uint32_t level;
2603 pnanovdb_address_t value_address;
2607 PNANOVDB_DEREF(acc).lower = child;
2608 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
2614 PNANOVDB_DEREF(level) = 2u;
2616 return value_address;
2621 pnanovdb_uint32_t level;
2628 pnanovdb_address_t ret;
2629 if (pnanovdb_address_is_null(tile.
address))
2631 ret = pnanovdb_address_offset(root.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_off_background));
2632 PNANOVDB_DEREF(level) = 4u;
2636 ret = pnanovdb_address_offset(tile.
address, PNANOVDB_GRID_TYPE_GET(grid_type, root_tile_off_value));
2637 PNANOVDB_DEREF(level) = 3u;
2642 PNANOVDB_DEREF(acc).upper = child;
2643 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
2651 pnanovdb_uint32_t level;
2659 pnanovdb_address_t value_address;
2663 PNANOVDB_DEREF(level) = 0u;
2677 return value_address;
2682 pnanovdb_uint32_t level;
2688 pnanovdb_uint32_t level;
2690 PNANOVDB_DEREF(bit_index) = level == 0u ? pnanovdb_int32_as_uint32(PNANOVDB_DEREF(ijk).x & 7) : 0u;
2704 pnanovdb_uint32_t ret;
2708 PNANOVDB_DEREF(acc).leaf = child;
2709 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
2722 pnanovdb_uint32_t ret;
2726 PNANOVDB_DEREF(acc).lower = child;
2727 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
2732 ret = (1u << (4u + 3u));
2740 pnanovdb_uint32_t ret;
2741 if (pnanovdb_address_is_null(tile.
address))
2743 ret = 1u << (5u + 4u + 3u);
2747 ret = 1u << (5u + 4u + 3u);
2752 PNANOVDB_DEREF(acc).upper = child;
2753 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
2763 pnanovdb_uint32_t dim;
2794 pnanovdb_bool_t is_active;
2798 PNANOVDB_DEREF(acc).leaf = child;
2799 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
2812 pnanovdb_bool_t is_active;
2816 PNANOVDB_DEREF(acc).lower = child;
2817 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
2830 pnanovdb_bool_t is_active;
2831 if (pnanovdb_address_is_null(tile.
address))
2833 is_active = PNANOVDB_FALSE;
2838 is_active = state != 0u;
2843 PNANOVDB_DEREF(acc).upper = child;
2844 PNANOVDB_DEREF(acc).key = PNANOVDB_DEREF(ijk);
2854 pnanovdb_bool_t is_active;
2878 pnanovdb_vec3_t dst;
2879 float sx = PNANOVDB_DEREF(src).x;
2880 float sy = PNANOVDB_DEREF(src).y;
2881 float sz = PNANOVDB_DEREF(src).z;
2890 pnanovdb_vec3_t dst;
2902 pnanovdb_vec3_t dst;
2903 float sx = PNANOVDB_DEREF(src).x;
2904 float sy = PNANOVDB_DEREF(src).y;
2905 float sz = PNANOVDB_DEREF(src).z;
2914 pnanovdb_vec3_t dst;
2915 float sx = PNANOVDB_DEREF(src).x;
2916 float sy = PNANOVDB_DEREF(src).y;
2917 float sz = PNANOVDB_DEREF(src).z;
3033 0.14425f, 0.643275f, 0.830409f, 0.331384f, 0.105263f, 0.604289f, 0.167641f, 0.666667f,
3034 0.892788f, 0.393762f, 0.0818713f, 0.580897f, 0.853801f, 0.354776f, 0.916179f, 0.417154f,
3035 0.612086f, 0.11306f, 0.79922f, 0.300195f, 0.510721f, 0.0116959f, 0.947368f, 0.448343f,
3036 0.362573f, 0.861598f, 0.0506823f, 0.549708f, 0.261209f, 0.760234f, 0.19883f, 0.697856f,
3037 0.140351f, 0.639376f, 0.576998f, 0.0779727f, 0.522417f, 0.0233918f, 0.460039f, 0.959064f,
3038 0.888889f, 0.389864f, 0.327485f, 0.826511f, 0.272904f, 0.77193f, 0.709552f, 0.210526f,
3039 0.483431f, 0.982456f, 0.296296f, 0.795322f, 0.116959f, 0.615984f, 0.0545809f, 0.553606f,
3040 0.732943f, 0.233918f, 0.545809f, 0.0467836f, 0.865497f, 0.366472f, 0.803119f, 0.304094f,
3041 0.518519f, 0.0194932f, 0.45614f, 0.955166f, 0.729045f, 0.230019f, 0.54191f, 0.042885f,
3042 0.269006f, 0.768031f, 0.705653f, 0.206628f, 0.479532f, 0.978558f, 0.292398f, 0.791423f,
3043 0.237817f, 0.736842f, 0.424951f, 0.923977f, 0.136452f, 0.635478f, 0.323587f, 0.822612f,
3044 0.986355f, 0.487329f, 0.674464f, 0.175439f, 0.88499f, 0.385965f, 0.573099f, 0.0740741f,
3045 0.51462f, 0.0155945f, 0.202729f, 0.701754f, 0.148148f, 0.647174f, 0.834308f, 0.335283f,
3046 0.265107f, 0.764133f, 0.951267f, 0.452242f, 0.896686f, 0.397661f, 0.08577f, 0.584795f,
3047 0.8577f, 0.358674f, 0.920078f, 0.421053f, 0.740741f, 0.241715f, 0.678363f, 0.179337f,
3048 0.109162f, 0.608187f, 0.17154f, 0.670565f, 0.491228f, 0.990253f, 0.42885f, 0.927875f,
3049 0.0662768f, 0.565302f, 0.62768f, 0.128655f, 0.183236f, 0.682261f, 0.744639f, 0.245614f,
3050 0.814815f, 0.315789f, 0.378168f, 0.877193f, 0.931774f, 0.432749f, 0.495127f, 0.994152f,
3051 0.0350877f, 0.534113f, 0.97076f, 0.471735f, 0.214425f, 0.71345f, 0.526316f, 0.0272904f,
3052 0.783626f, 0.2846f, 0.222222f, 0.721248f, 0.962963f, 0.463938f, 0.276803f, 0.775828f,
3053 0.966862f, 0.467836f, 0.405458f, 0.904483f, 0.0701754f, 0.569201f, 0.881092f, 0.382066f,
3054 0.218324f, 0.717349f, 0.654971f, 0.155945f, 0.818713f, 0.319688f, 0.132554f, 0.631579f,
3055 0.0623782f, 0.561404f, 0.748538f, 0.249513f, 0.912281f, 0.413255f, 0.974659f, 0.475634f,
3056 0.810916f, 0.311891f, 0.499025f, 0.998051f, 0.163743f, 0.662768f, 0.226121f, 0.725146f,
3057 0.690058f, 0.191033f, 0.00389864f, 0.502924f, 0.557505f, 0.0584795f, 0.120858f, 0.619883f,
3058 0.440546f, 0.939571f, 0.752437f, 0.253411f, 0.307992f, 0.807018f, 0.869396f, 0.37037f,
3059 0.658869f, 0.159844f, 0.346979f, 0.846004f, 0.588694f, 0.0896686f, 0.152047f, 0.651072f,
3060 0.409357f, 0.908382f, 0.596491f, 0.0974659f, 0.339181f, 0.838207f, 0.900585f, 0.401559f,
3061 0.34308f, 0.842105f, 0.779727f, 0.280702f, 0.693957f, 0.194932f, 0.25731f, 0.756335f,
3062 0.592593f, 0.0935673f, 0.0311891f, 0.530214f, 0.444444f, 0.94347f, 0.506823f, 0.00779727f,
3063 0.68616f, 0.187135f, 0.124756f, 0.623782f, 0.288499f, 0.787524f, 0.350877f, 0.849903f,
3064 0.436647f, 0.935673f, 0.873294f, 0.374269f, 0.538012f, 0.0389864f, 0.60039f, 0.101365f,
3065 0.57115f, 0.0721248f, 0.758285f, 0.259259f, 0.719298f, 0.220273f, 0.532164f, 0.0331384f,
3066 0.321637f, 0.820663f, 0.00974659f, 0.508772f, 0.469786f, 0.968811f, 0.282651f, 0.781676f,
3067 0.539961f, 0.0409357f, 0.727096f, 0.22807f, 0.500975f, 0.00194932f, 0.563353f, 0.0643275f,
3068 0.290448f, 0.789474f, 0.477583f, 0.976608f, 0.251462f, 0.750487f, 0.31384f, 0.812865f,
3069 0.94152f, 0.442495f, 0.879142f, 0.380117f, 0.37232f, 0.871345f, 0.309942f, 0.808967f,
3070 0.192982f, 0.692008f, 0.130604f, 0.62963f, 0.621832f, 0.122807f, 0.559454f, 0.0604289f,
3071 0.660819f, 0.161793f, 0.723197f, 0.224172f, 0.403509f, 0.902534f, 0.840156f, 0.341131f,
3072 0.411306f, 0.910331f, 0.473684f, 0.97271f, 0.653021f, 0.153996f, 0.0916179f, 0.590643f,
3073 0.196881f, 0.695906f, 0.384016f, 0.883041f, 0.0955166f, 0.594542f, 0.157895f, 0.65692f,
3074 0.945419f, 0.446394f, 0.633528f, 0.134503f, 0.844055f, 0.345029f, 0.906433f, 0.407407f,
3075 0.165692f, 0.664717f, 0.103314f, 0.602339f, 0.126706f, 0.625731f, 0.189084f, 0.688109f,
3076 0.91423f, 0.415205f, 0.851852f, 0.352827f, 0.875244f, 0.376218f, 0.937622f, 0.438596f,
3077 0.317739f, 0.816764f, 0.255361f, 0.754386f, 0.996101f, 0.497076f, 0.933723f, 0.434698f,
3078 0.567251f, 0.0682261f, 0.504873f, 0.00584795f, 0.247563f, 0.746589f, 0.185185f, 0.684211f,
3079 0.037037f, 0.536062f, 0.0994152f, 0.598441f, 0.777778f, 0.278752f, 0.465887f, 0.964912f,
3080 0.785575f, 0.28655f, 0.847953f, 0.348928f, 0.0292398f, 0.528265f, 0.7154f, 0.216374f,
3081 0.39961f, 0.898636f, 0.961014f, 0.461988f, 0.0487329f, 0.547758f, 0.111111f, 0.610136f,
3082 0.649123f, 0.150097f, 0.212476f, 0.711501f, 0.797271f, 0.298246f, 0.859649f, 0.360624f,
3083 0.118908f, 0.617934f, 0.0565302f, 0.555556f, 0.329435f, 0.82846f, 0.516569f, 0.0175439f,
3084 0.867446f, 0.368421f, 0.805068f, 0.306043f, 0.578947f, 0.079922f, 0.267057f, 0.766082f,
3085 0.270955f, 0.76998f, 0.707602f, 0.208577f, 0.668616f, 0.169591f, 0.606238f, 0.107212f,
3086 0.520468f, 0.0214425f, 0.45809f, 0.957115f, 0.419103f, 0.918129f, 0.356725f, 0.855751f,
3087 0.988304f, 0.489279f, 0.426901f, 0.925926f, 0.450292f, 0.949318f, 0.512671f, 0.0136452f,
3088 0.239766f, 0.738791f, 0.676413f, 0.177388f, 0.699805f, 0.20078f, 0.263158f, 0.762183f,
3089 0.773879f, 0.274854f, 0.337232f, 0.836257f, 0.672515f, 0.173489f, 0.734893f, 0.235867f,
3090 0.0253411f, 0.524366f, 0.586745f, 0.0877193f, 0.423002f, 0.922027f, 0.48538f, 0.984405f,
3091 0.74269f, 0.243665f, 0.680312f, 0.181287f, 0.953216f, 0.454191f, 0.1423f, 0.641326f,
3092 0.493177f, 0.992203f, 0.430799f, 0.929825f, 0.204678f, 0.703704f, 0.890838f, 0.391813f,
3093 0.894737f, 0.395712f, 0.0838207f, 0.582846f, 0.0448343f, 0.54386f, 0.231969f, 0.730994f,
3094 0.146199f, 0.645224f, 0.832359f, 0.333333f, 0.793372f, 0.294347f, 0.980507f, 0.481481f,
3095 0.364522f, 0.863548f, 0.80117f, 0.302144f, 0.824561f, 0.325536f, 0.138402f, 0.637427f,
3096 0.614035f, 0.11501f, 0.0526316f, 0.551657f, 0.0760234f, 0.575049f, 0.88694f, 0.387914f,
3101 return enabled ? pnanovdb_dither_lut[offset & 511] : 0.5f;
3106 #ifdef PNANOVDB_HDDA 3109 #define PNANOVDB_ENFORCE_FORWARD_STEPPING 3111 #define PNANOVDB_HDDA_FLOAT_MAX 1e38f 3113 struct pnanovdb_hdda_t
3115 pnanovdb_int32_t dim;
3118 pnanovdb_coord_t voxel;
3119 pnanovdb_coord_t step;
3120 pnanovdb_vec3_t delta;
3121 pnanovdb_vec3_t next;
3123 PNANOVDB_STRUCT_TYPEDEF(pnanovdb_hdda_t)
3125 PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_hdda_pos_to_ijk(PNANOVDB_IN(pnanovdb_vec3_t) pos)
3127 pnanovdb_coord_t voxel;
3128 voxel.x = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).x));
3129 voxel.y = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).y));
3130 voxel.z = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).z));
3134 PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_hdda_pos_to_voxel(PNANOVDB_IN(pnanovdb_vec3_t) pos,
int dim)
3136 pnanovdb_coord_t voxel;
3137 voxel.x = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).x)) & (~(dim - 1));
3138 voxel.y = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).y)) & (~(dim - 1));
3139 voxel.z = pnanovdb_float_to_int32(pnanovdb_floor(PNANOVDB_DEREF(pos).z)) & (~(dim - 1));
3143 PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_hdda_ray_start(PNANOVDB_IN(pnanovdb_vec3_t) origin,
float tmin, PNANOVDB_IN(pnanovdb_vec3_t) direction)
3145 pnanovdb_vec3_t pos = pnanovdb_vec3_add(
3146 pnanovdb_vec3_mul(PNANOVDB_DEREF(direction), pnanovdb_vec3_uniform(tmin)),
3147 PNANOVDB_DEREF(origin)
3152 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)
3154 PNANOVDB_DEREF(hdda).dim = dim;
3155 PNANOVDB_DEREF(hdda).tmin = tmin;
3156 PNANOVDB_DEREF(hdda).tmax = tmax;
3158 pnanovdb_vec3_t pos = pnanovdb_hdda_ray_start(origin, tmin, direction);
3159 pnanovdb_vec3_t dir_inv = pnanovdb_vec3_div(pnanovdb_vec3_uniform(1.f), PNANOVDB_DEREF(direction));
3161 PNANOVDB_DEREF(hdda).voxel = pnanovdb_hdda_pos_to_voxel(PNANOVDB_REF(pos), dim);
3164 if (PNANOVDB_DEREF(direction).x == 0.f)
3166 PNANOVDB_DEREF(hdda).next.x = PNANOVDB_HDDA_FLOAT_MAX;
3167 PNANOVDB_DEREF(hdda).step.x = 0;
3168 PNANOVDB_DEREF(hdda).delta.x = 0.f;
3170 else if (dir_inv.x > 0.f)
3172 PNANOVDB_DEREF(hdda).step.x = 1;
3173 PNANOVDB_DEREF(hdda).next.x = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.x + dim - pos.x) * dir_inv.x;
3174 PNANOVDB_DEREF(hdda).delta.x = dir_inv.x;
3178 PNANOVDB_DEREF(hdda).step.x = -1;
3179 PNANOVDB_DEREF(hdda).next.x = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.x - pos.x) * dir_inv.x;
3180 PNANOVDB_DEREF(hdda).delta.x = -dir_inv.x;
3184 if (PNANOVDB_DEREF(direction).y == 0.f)
3186 PNANOVDB_DEREF(hdda).next.y = PNANOVDB_HDDA_FLOAT_MAX;
3187 PNANOVDB_DEREF(hdda).step.y = 0;
3188 PNANOVDB_DEREF(hdda).delta.y = 0.f;
3190 else if (dir_inv.y > 0.f)
3192 PNANOVDB_DEREF(hdda).step.y = 1;
3193 PNANOVDB_DEREF(hdda).next.y = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.y + dim - pos.y) * dir_inv.y;
3194 PNANOVDB_DEREF(hdda).delta.y = dir_inv.y;
3198 PNANOVDB_DEREF(hdda).step.y = -1;
3199 PNANOVDB_DEREF(hdda).next.y = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.y - pos.y) * dir_inv.y;
3200 PNANOVDB_DEREF(hdda).delta.y = -dir_inv.y;
3204 if (PNANOVDB_DEREF(direction).z == 0.f)
3206 PNANOVDB_DEREF(hdda).next.z = PNANOVDB_HDDA_FLOAT_MAX;
3207 PNANOVDB_DEREF(hdda).step.z = 0;
3208 PNANOVDB_DEREF(hdda).delta.z = 0.f;
3210 else if (dir_inv.z > 0.f)
3212 PNANOVDB_DEREF(hdda).step.z = 1;
3213 PNANOVDB_DEREF(hdda).next.z = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.z + dim - pos.z) * dir_inv.z;
3214 PNANOVDB_DEREF(hdda).delta.z = dir_inv.z;
3218 PNANOVDB_DEREF(hdda).step.z = -1;
3219 PNANOVDB_DEREF(hdda).next.z = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.z - pos.z) * dir_inv.z;
3220 PNANOVDB_DEREF(hdda).delta.z = -dir_inv.z;
3224 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)
3226 if (PNANOVDB_DEREF(hdda).dim == dim)
3228 return PNANOVDB_FALSE;
3230 PNANOVDB_DEREF(hdda).dim = dim;
3232 pnanovdb_vec3_t pos = pnanovdb_vec3_add(
3233 pnanovdb_vec3_mul(PNANOVDB_DEREF(direction), pnanovdb_vec3_uniform(PNANOVDB_DEREF(hdda).tmin)),
3234 PNANOVDB_DEREF(origin)
3236 pnanovdb_vec3_t dir_inv = pnanovdb_vec3_div(pnanovdb_vec3_uniform(1.f), PNANOVDB_DEREF(direction));
3238 PNANOVDB_DEREF(hdda).voxel = pnanovdb_hdda_pos_to_voxel(PNANOVDB_REF(pos), dim);
3240 if (PNANOVDB_DEREF(hdda).step.x != 0)
3242 PNANOVDB_DEREF(hdda).next.x = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.x - pos.x) * dir_inv.x;
3243 if (PNANOVDB_DEREF(hdda).step.x > 0)
3245 PNANOVDB_DEREF(hdda).next.x += dim * dir_inv.x;
3248 if (PNANOVDB_DEREF(hdda).step.y != 0)
3250 PNANOVDB_DEREF(hdda).next.y = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.y - pos.y) * dir_inv.y;
3251 if (PNANOVDB_DEREF(hdda).step.y > 0)
3253 PNANOVDB_DEREF(hdda).next.y += dim * dir_inv.y;
3256 if (PNANOVDB_DEREF(hdda).step.z != 0)
3258 PNANOVDB_DEREF(hdda).next.z = PNANOVDB_DEREF(hdda).tmin + (PNANOVDB_DEREF(hdda).voxel.z - pos.z) * dir_inv.z;
3259 if (PNANOVDB_DEREF(hdda).step.z > 0)
3261 PNANOVDB_DEREF(hdda).next.z += dim * dir_inv.z;
3265 return PNANOVDB_TRUE;
3268 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_hdda_step(PNANOVDB_INOUT(pnanovdb_hdda_t) hdda)
3270 pnanovdb_bool_t ret;
3271 if (PNANOVDB_DEREF(hdda).next.x < PNANOVDB_DEREF(hdda).next.y && PNANOVDB_DEREF(hdda).next.x < PNANOVDB_DEREF(hdda).next.z)
3273 #ifdef PNANOVDB_ENFORCE_FORWARD_STEPPING 3274 if (PNANOVDB_DEREF(hdda).next.x <= PNANOVDB_DEREF(hdda).tmin)
3276 PNANOVDB_DEREF(hdda).next.x += PNANOVDB_DEREF(hdda).tmin - 0.999999f * PNANOVDB_DEREF(hdda).next.x + 1.0e-6f;
3279 PNANOVDB_DEREF(hdda).tmin = PNANOVDB_DEREF(hdda).next.x;
3280 PNANOVDB_DEREF(hdda).next.x += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).delta.x;
3281 PNANOVDB_DEREF(hdda).voxel.x += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).step.x;
3282 ret = PNANOVDB_DEREF(hdda).tmin <= PNANOVDB_DEREF(hdda).tmax;
3284 else if (PNANOVDB_DEREF(hdda).next.y < PNANOVDB_DEREF(hdda).next.z)
3286 #ifdef PNANOVDB_ENFORCE_FORWARD_STEPPING 3287 if (PNANOVDB_DEREF(hdda).next.y <= PNANOVDB_DEREF(hdda).tmin)
3289 PNANOVDB_DEREF(hdda).next.y += PNANOVDB_DEREF(hdda).tmin - 0.999999f * PNANOVDB_DEREF(hdda).next.y + 1.0e-6f;
3292 PNANOVDB_DEREF(hdda).tmin = PNANOVDB_DEREF(hdda).next.y;
3293 PNANOVDB_DEREF(hdda).next.y += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).delta.y;
3294 PNANOVDB_DEREF(hdda).voxel.y += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).step.y;
3295 ret = PNANOVDB_DEREF(hdda).tmin <= PNANOVDB_DEREF(hdda).tmax;
3299 #ifdef PNANOVDB_ENFORCE_FORWARD_STEPPING 3300 if (PNANOVDB_DEREF(hdda).next.z <= PNANOVDB_DEREF(hdda).tmin)
3302 PNANOVDB_DEREF(hdda).next.z += PNANOVDB_DEREF(hdda).tmin - 0.999999f * PNANOVDB_DEREF(hdda).next.z + 1.0e-6f;
3305 PNANOVDB_DEREF(hdda).tmin = PNANOVDB_DEREF(hdda).next.z;
3306 PNANOVDB_DEREF(hdda).next.z += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).delta.z;
3307 PNANOVDB_DEREF(hdda).voxel.z += PNANOVDB_DEREF(hdda).dim * PNANOVDB_DEREF(hdda).step.z;
3308 ret = PNANOVDB_DEREF(hdda).tmin <= PNANOVDB_DEREF(hdda).tmax;
3313 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_hdda_ray_clip(
3314 PNANOVDB_IN(pnanovdb_vec3_t) bbox_min,
3315 PNANOVDB_IN(pnanovdb_vec3_t) bbox_max,
3316 PNANOVDB_IN(pnanovdb_vec3_t) origin, PNANOVDB_INOUT(
float) tmin,
3317 PNANOVDB_IN(pnanovdb_vec3_t) direction, PNANOVDB_INOUT(
float) tmax
3320 pnanovdb_vec3_t dir_inv = pnanovdb_vec3_div(pnanovdb_vec3_uniform(1.f), PNANOVDB_DEREF(direction));
3321 pnanovdb_vec3_t t0 = pnanovdb_vec3_mul(pnanovdb_vec3_sub(PNANOVDB_DEREF(bbox_min), PNANOVDB_DEREF(origin)), dir_inv);
3322 pnanovdb_vec3_t t1 = pnanovdb_vec3_mul(pnanovdb_vec3_sub(PNANOVDB_DEREF(bbox_max), PNANOVDB_DEREF(origin)), dir_inv);
3323 pnanovdb_vec3_t tmin3 = pnanovdb_vec3_min(t0, t1);
3324 pnanovdb_vec3_t tmax3 = pnanovdb_vec3_max(t0, t1);
3325 float tnear = pnanovdb_max(tmin3.x, pnanovdb_max(tmin3.y, tmin3.z));
3326 float tfar = pnanovdb_min(tmax3.x, pnanovdb_min(tmax3.y, tmax3.z));
3327 pnanovdb_bool_t hit = tnear <= tfar;
3328 PNANOVDB_DEREF(tmin) = pnanovdb_max(PNANOVDB_DEREF(tmin), tnear);
3329 PNANOVDB_DEREF(tmax) = pnanovdb_min(PNANOVDB_DEREF(tmax), tfar);
3333 PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_hdda_zero_crossing(
3334 pnanovdb_grid_type_t grid_type,
3337 PNANOVDB_IN(pnanovdb_vec3_t) origin,
float tmin,
3338 PNANOVDB_IN(pnanovdb_vec3_t) direction,
float tmax,
3339 PNANOVDB_INOUT(
float) thit,
3340 PNANOVDB_INOUT(
float) v
3345 pnanovdb_vec3_t bbox_minf = pnanovdb_coord_to_vec3(bbox_min);
3346 pnanovdb_vec3_t bbox_maxf = pnanovdb_coord_to_vec3(pnanovdb_coord_add(bbox_max, pnanovdb_coord_uniform(1)));
3348 pnanovdb_bool_t hit = pnanovdb_hdda_ray_clip(PNANOVDB_REF(bbox_minf), PNANOVDB_REF(bbox_maxf), origin, PNANOVDB_REF(tmin), direction, PNANOVDB_REF(tmax));
3349 if (!hit || tmax > 1.0e20f)
3351 return PNANOVDB_FALSE;
3354 pnanovdb_vec3_t pos = pnanovdb_hdda_ray_start(origin, tmin, direction);
3355 pnanovdb_coord_t ijk = pnanovdb_hdda_pos_to_ijk(PNANOVDB_REF(pos));
3361 pnanovdb_hdda_t hdda;
3362 pnanovdb_hdda_init(PNANOVDB_REF(hdda), origin, tmin, direction, tmax, dim);
3363 while (pnanovdb_hdda_step(PNANOVDB_REF(hdda)))
3365 pnanovdb_vec3_t pos_start = pnanovdb_hdda_ray_start(origin, hdda.tmin + 1.0001f, direction);
3366 ijk = pnanovdb_hdda_pos_to_ijk(PNANOVDB_REF(pos_start));
3368 pnanovdb_hdda_update(PNANOVDB_REF(hdda), origin, direction, dim);
3378 if (PNANOVDB_DEREF(v) * v0 < 0.f)
3380 PNANOVDB_DEREF(thit) = hdda.tmin;
3381 return PNANOVDB_TRUE;
3385 return PNANOVDB_FALSE;
3390 #endif // end of NANOVDB_PNANOVDB_H_HAS_BEEN_INCLUDED pnanovdb_map_t map
Definition: PNanoVDB.h:1095
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:2362
#define PNANOVDB_GRID_TYPE_END
Definition: PNanoVDB.h:966
pnanovdb_uint32_t node_count_lower
Definition: PNanoVDB.h:1288
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:2936
PNANOVDB_FORCE_INLINE double pnanovdb_map_get_taperd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1056
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:1826
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:2390
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_tile_count_leaf(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1334
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:2240
pnanovdb_coord_t bbox_max
Definition: PNanoVDB.h:1515
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_node_count_lower(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1328
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_read_vec3u16(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:843
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_pointindex_get_offset(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:2086
#define PNANOVDB_ROOT_TILE_OFF_KEY
Definition: PNanoVDB.h:1433
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindexmask_get_last_offset(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:2031
PNANOVDB_FORCE_INLINE void pnanovdb_lower_set_bbox_max(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p, PNANOVDB_IN(pnanovdb_coord_t) bbox_max)
Definition: PNanoVDB.h:1556
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:2850
#define PNANOVDB_GRID_SIZE
Definition: PNanoVDB.h:1108
PNANOVDB_FORCE_INLINE pnanovdb_root_handle_t pnanovdb_tree_get_root(pnanovdb_buf_t buf, pnanovdb_tree_handle_t tree)
Definition: PNanoVDB.h:1699
pnanovdb_uint32_t grid_type
Definition: PNanoVDB.h:1099
pnanovdb_uint32_t root_tile_size
Definition: PNanoVDB.h:1619
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_gridblindmetadata_get_data_type(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:1274
#define PNANOVDB_GRID_TYPE_VEC3U16
Definition: PNanoVDB.h:964
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_read_uint32(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:792
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_index_get_min_index(pnanovdb_buf_t buf, pnanovdb_address_t min_address)
Definition: PNanoVDB.h:1856
Definition: PNanoVDB.h:1608
pnanovdb_lower_handle_t lower
Definition: PNanoVDB.h:2510
#define PNANOVDB_LEAF_OFF_BBOX_MIN
Definition: PNanoVDB.h:1582
#define PNANOVDB_UPPER_OFF_FLAGS
Definition: PNanoVDB.h:1476
PNANOVDB_FORCE_INLINE void pnanovdb_write_int32(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_int32_t value)
Definition: PNanoVDB.h:900
Definition: PNanoVDB.h:1296
Definition: PNanoVDB.h:1085
#define PNANOVDB_MAP_OFF_MATF
Definition: PNanoVDB.h:1026
#define PNANOVDB_UPPER_OFF_BBOX_MAX
Definition: PNanoVDB.h:1475
pnanovdb_upper_handle_t upper
Definition: PNanoVDB.h:2511
#define PNANOVDB_LOWER_OFF_BBOX_MAX
Definition: PNanoVDB.h:1530
Definition: PNanoVDB.h:1523
PNANOVDB_FORCE_INLINE void pnanovdb_root_tile_set_state(pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t p, pnanovdb_uint32_t state)
Definition: PNanoVDB.h:1453
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_indexmask_get_ave_index(pnanovdb_buf_t buf, pnanovdb_address_t ave_address)
Definition: PNanoVDB.h:1897
PNANOVDB_FORCE_INLINE void pnanovdb_leaf_pointindex_set_value(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t i, pnanovdb_uint32_t value)
Definition: PNanoVDB.h:2131
#define PNANOVDB_GRID_OFF_MAGIC
Definition: PNanoVDB.h:1110
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:2314
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_index_get_ave_index(pnanovdb_buf_t buf, pnanovdb_address_t ave_address)
Definition: PNanoVDB.h:1866
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_uint64_any_bit(pnanovdb_uint64_t a)
Definition: PNanoVDB.h:659
pnanovdb_uint32_t lower_off_max
Definition: PNanoVDB.h:1627
pnanovdb_coord_t key
Definition: PNanoVDB.h:2508
PNANOVDB_FORCE_INLINE void pnanovdb_lower_set_table_child(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_lower_handle_t node, pnanovdb_uint32_t n, pnanovdb_int64_t child)
Definition: PNanoVDB.h:2594
PNANOVDB_FORCE_INLINE void pnanovdb_root_set_bbox_min(pnanovdb_buf_t buf, pnanovdb_root_handle_t p, PNANOVDB_IN(pnanovdb_coord_t) bbox_min)
Definition: PNanoVDB.h:1409
pnanovdb_address_t address
Definition: PNanoVDB.h:1428
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:2258
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_read_uint64(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:796
#define PNANOVDB_UPPER_OFF_VALUE_MASK
Definition: PNanoVDB.h:1477
PNANOVDB_FORCE_INLINE pnanovdb_tree_handle_t pnanovdb_grid_get_tree(pnanovdb_buf_t buf, pnanovdb_grid_handle_t grid)
Definition: PNanoVDB.h:1692
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_leaf_onindexmask_get_value_count(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:2027
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_node_offset_upper(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1319
#define PNANOVDB_MAP_OFF_INVMATD
Definition: PNanoVDB.h:1031
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_checksum(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint64_t checksum)
Definition: PNanoVDB.h:1177
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_grid_count(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1141
pnanovdb_uint32_t value_stride_bits
Definition: PNanoVDB.h:1616
pnanovdb_uint32_t root_off_max
Definition: PNanoVDB.h:1612
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_readaccessor_iscached2(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, int dirty)
Definition: PNanoVDB.h:2547
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:1831
pnanovdb_uint32_t root_size
Definition: PNanoVDB.h:1615
pnanovdb_uint32_t lower_off_min
Definition: PNanoVDB.h:1626
PNANOVDB_FORCE_INLINE void pnanovdb_root_tile_set_key(pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t p, pnanovdb_uint64_t key)
Definition: PNanoVDB.h:1447
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:2600
#define PNANOVDB_UPPER_OFF_CHILD_MASK
Definition: PNanoVDB.h:1478
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_index_get_dev_index(pnanovdb_buf_t buf, pnanovdb_address_t dev_address)
Definition: PNanoVDB.h:1871
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_upper_get_flags(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p)
Definition: PNanoVDB.h:1486
pnanovdb_address_t address
Definition: PNanoVDB.h:1390
pnanovdb_uint64_t voxel_count
Definition: PNanoVDB.h:1293
#define PNANOVDB_TREE_OFF_TILE_COUNT_LOWER
Definition: PNanoVDB.h:1309
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_grid_index(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1138
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_upper_get_bbox_min(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p)
Definition: PNanoVDB.h:1480
pnanovdb_uint32_t leaf_off_max
Definition: PNanoVDB.h:1633
PNANOVDB_FORCE_INLINE void pnanovdb_write_double(pnanovdb_buf_t buf, pnanovdb_address_t address, double value)
Definition: PNanoVDB.h:912
pnanovdb_address_t address
Definition: PNanoVDB.h:1523
PNANOVDB_FORCE_INLINE int pnanovdb_readaccessor_computedirty(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:2557
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindex_get_dev_index(pnanovdb_buf_t buf, pnanovdb_address_t dev_address)
Definition: PNanoVDB.h:1989
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:2759
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_node_offset_leaf(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint64_t node_offset_leaf)
Definition: PNanoVDB.h:1347
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:2809
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:2176
Definition: PNanoVDB.h:1281
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_readaccessor_iscached0(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, int dirty)
Definition: PNanoVDB.h:2527
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_read_vec3u8(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:852
#define PNANOVDB_ROOT_OFF_BBOX_MIN
Definition: PNanoVDB.h:1395
#define PNANOVDB_GRID_OFF_VOXEL_SIZE
Definition: PNanoVDB.h:1120
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:1796
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:2207
#define PNANOVDB_GRID_TYPE_VEC3U8
Definition: PNanoVDB.h:963
pnanovdb_uint32_t upper_off_table
Definition: PNanoVDB.h:1624
pnanovdb_uint64_t grid_size
Definition: PNanoVDB.h:1093
PNANOVDB_STATIC_CONST pnanovdb_grid_type_constants_t pnanovdb_grid_type_constants[27]
Definition: PNanoVDB.h:1642
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_root_pointindex_get_point_range(pnanovdb_buf_t buf, pnanovdb_address_t value_address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level, PNANOVDB_INOUT(pnanovdb_uint64_t) range_begin, PNANOVDB_INOUT(pnanovdb_uint64_t) range_end)
Definition: PNanoVDB.h:2446
#define PNANOVDB_ROOT_OFF_BBOX_MAX
Definition: PNanoVDB.h:1396
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_leaf_onindexmask_get_mask_bit(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:2059
PNANOVDB_FORCE_INLINE void pnanovdb_root_tile_set_child(pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t p, pnanovdb_int64_t child)
Definition: PNanoVDB.h:1450
#define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_CLASS
Definition: PNanoVDB.h:1255
pnanovdb_uint32_t leaf_size
Definition: PNanoVDB.h:1637
#define PNANOVDB_GRID_OFF_FLAGS
Definition: PNanoVDB.h:1113
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_voxel_count(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1343
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_tile_count_lower(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint32_t tile_count_lower)
Definition: PNanoVDB.h:1371
pnanovdb_uint32_t upper_size
Definition: PNanoVDB.h:1625
PNANOVDB_FORCE_INLINE void pnanovdb_leaf_onindexmask_set_mask_bit(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t n, pnanovdb_bool_t v)
Definition: PNanoVDB.h:2067
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_read_coord(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:816
pnanovdb_uint32_t root_off_stddev
Definition: PNanoVDB.h:1614
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:1548
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_gridblindmetadata_get_value_size(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:1265
PNANOVDB_FORCE_INLINE void pnanovdb_lower_set_child_mask(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p, pnanovdb_uint32_t bit_index, pnanovdb_bool_t value)
Definition: PNanoVDB.h:1559
#define PNANOVDB_MAP_OFF_VECF
Definition: PNanoVDB.h:1028
pnanovdb_int64_t blind_metadata_offset
Definition: PNanoVDB.h:1100
PNANOVDB_FORCE_INLINE double pnanovdb_map_get_vecd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1053
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindex_get_min_index(pnanovdb_buf_t buf, pnanovdb_address_t min_address)
Definition: PNanoVDB.h:1956
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindexmask_get_ave_index(pnanovdb_buf_t buf, pnanovdb_address_t ave_address)
Definition: PNanoVDB.h:2047
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:1675
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_node_count_leaf(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1325
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindexmask_get_value_index(pnanovdb_buf_t buf, pnanovdb_address_t value_address, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:2055
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_node_offset_root(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint64_t node_offset_root)
Definition: PNanoVDB.h:1356
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_uint32_countbits(pnanovdb_uint32_t value)
Definition: PNanoVDB.h:554
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_grid_get_blind_metadata_offset(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1167
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:1155
pnanovdb_coord_t bbox_min
Definition: PNanoVDB.h:1514
pnanovdb_uint32_t version
Definition: PNanoVDB.h:1089
#define PNANOVDB_LOWER_OFF_FLAGS
Definition: PNanoVDB.h:1531
#define PNANOVDB_TREE_OFF_NODE_OFFSET_LOWER
Definition: PNanoVDB.h:1302
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_version_get_minor(pnanovdb_uint32_t version)
Definition: PNanoVDB.h:1226
Definition: PNanoVDB.h:1567
PNANOVDB_FORCE_INLINE double pnanovdb_map_get_invmatd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1050
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_uint64_countbits(pnanovdb_uint64_t value)
Definition: PNanoVDB.h:574
#define PNANOVDB_UPPER_OFF_BBOX_MIN
Definition: PNanoVDB.h:1474
Definition: PNanoVDB.h:1419
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:2164
#define PNANOVDB_TREE_OFF_TILE_COUNT_UPPER
Definition: PNanoVDB.h:1310
PNANOVDB_FORCE_INLINE void pnanovdb_upper_set_child_mask(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p, pnanovdb_uint32_t bit_index, pnanovdb_bool_t value)
Definition: PNanoVDB.h:1504
#define PNANOVDB_TREE_OFF_NODE_OFFSET_ROOT
Definition: PNanoVDB.h:1304
#define PNANOVDB_ROOT_TILE_OFF_STATE
Definition: PNanoVDB.h:1435
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_pointindex_get_value(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t i)
Definition: PNanoVDB.h:2104
#define PNANOVDB_MAP_OFF_TAPERF
Definition: PNanoVDB.h:1029
pnanovdb_uint32_t grid_index
Definition: PNanoVDB.h:1091
pnanovdb_uint64_t node_offset_lower
Definition: PNanoVDB.h:1284
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_tile_count_upper(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1340
pnanovdb_uint32_t node_count_leaf
Definition: PNanoVDB.h:1287
#define PNANOVDB_LOWER_OFF_VALUE_MASK
Definition: PNanoVDB.h:1532
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:1147
pnanovdb_uint64_t checksum
Definition: PNanoVDB.h:1088
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_upper_get_bbox_max(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p)
Definition: PNanoVDB.h:1483
#define PNANOVDB_TREE_OFF_TILE_COUNT_LEAF
Definition: PNanoVDB.h:1308
pnanovdb_uint32_t pad1
Definition: PNanoVDB.h:1424
pnanovdb_uint32_t grid_count
Definition: PNanoVDB.h:1092
float taperf
Definition: PNanoVDB.h:1014
pnanovdb_uint64_t flags
Definition: PNanoVDB.h:1516
PNANOVDB_FORCE_INLINE void pnanovdb_write_vec3(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_vec3_t) value)
Definition: PNanoVDB.h:922
#define PNANOVDB_LOWER_OFF_CHILD_MASK
Definition: PNanoVDB.h:1533
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_tile_count_lower(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1337
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:2282
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindex_get_ave_index(pnanovdb_buf_t buf, pnanovdb_address_t ave_address)
Definition: PNanoVDB.h:1978
pnanovdb_uint32_t lower_off_ave
Definition: PNanoVDB.h:1628
pnanovdb_uint32_t bbox_dif_and_flags
Definition: PNanoVDB.h:1570
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_lower_get_bbox_max(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p)
Definition: PNanoVDB.h:1538
#define PNANOVDB_GRIDBLINDMETADATA_OFF_VALUE_COUNT
Definition: PNanoVDB.h:1252
pnanovdb_address_t address
Definition: PNanoVDB.h:1105
PNANOVDB_FORCE_INLINE float pnanovdb_dither_lookup(pnanovdb_bool_t enabled, int offset)
Definition: PNanoVDB.h:3099
pnanovdb_coord_t bbox_min
Definition: PNanoVDB.h:1569
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:2404
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:2189
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_index_get_value_index(pnanovdb_buf_t buf, pnanovdb_address_t value_address, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1876
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_leaf_get_bbox_min(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t p)
Definition: PNanoVDB.h:1590
pnanovdb_uint32_t blind_metadata_count
Definition: PNanoVDB.h:1101
PNANOVDB_FORCE_INLINE void pnanovdb_map_set_taperd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index, double taperd)
Definition: PNanoVDB.h:1081
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:2619
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_node_count_upper(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint32_t node_count_upper)
Definition: PNanoVDB.h:1365
pnanovdb_uint32_t leaf_off_min
Definition: PNanoVDB.h:1632
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:2696
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:2302
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_gridblindmetadata_get_value_count(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:1262
#define PNANOVDB_TREE_OFF_NODE_COUNT_LEAF
Definition: PNanoVDB.h:1305
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_grid_index(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t grid_index)
Definition: PNanoVDB.h:1186
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:2791
pnanovdb_uint32_t upper_off_min
Definition: PNanoVDB.h:1620
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_flags(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t flags)
Definition: PNanoVDB.h:1183
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_readaccessor_iscached1(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, int dirty)
Definition: PNanoVDB.h:2537
pnanovdb_uint32_t table_stride
Definition: PNanoVDB.h:1617
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_stat_strides_bits[27]
Definition: PNanoVDB.h:1005
#define PNANOVDB_GRID_OFF_GRID_COUNT
Definition: PNanoVDB.h:1115
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:2686
pnanovdb_uint32_t upper_off_max
Definition: PNanoVDB.h:1621
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_root_get_bbox_max(pnanovdb_buf_t buf, pnanovdb_root_handle_t p)
Definition: PNanoVDB.h:1402
#define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_TYPE
Definition: PNanoVDB.h:1256
Definition: PNanoVDB.h:1381
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_grid_get_magic(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1126
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:2737
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_version_get_major(pnanovdb_uint32_t version)
Definition: PNanoVDB.h:1222
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:2308
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_root_pointindex_get_point_address_range(pnanovdb_buf_t buf, pnanovdb_grid_type_t value_type, pnanovdb_address_t value_address, pnanovdb_address_t blindmetadata_value_address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level, PNANOVDB_INOUT(pnanovdb_address_t) address_begin, PNANOVDB_INOUT(pnanovdb_address_t) address_end)
Definition: PNanoVDB.h:2475
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_lower_get_flags(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p)
Definition: PNanoVDB.h:1541
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_node_offset_leaf(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1313
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:2182
#define PNANOVDB_LEAF_OFF_BBOX_DIF_AND_FLAGS
Definition: PNanoVDB.h:1583
PNANOVDB_FORCE_INLINE void pnanovdb_map_set_taperf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index, float taperf)
Definition: PNanoVDB.h:1069
PNANOVDB_FORCE_INLINE void pnanovdb_map_set_invmatd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index, double invmatd)
Definition: PNanoVDB.h:1075
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_value_strides_bits[27]
Definition: PNanoVDB.h:997
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_minmax_strides_bits[27]
Definition: PNanoVDB.h:1001
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_root_tile_get_key(pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t p)
Definition: PNanoVDB.h:1437
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:2222
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindexmask_get_max_index(pnanovdb_buf_t buf, pnanovdb_address_t max_address)
Definition: PNanoVDB.h:2043
PNANOVDB_FORCE_INLINE void pnanovdb_upper_set_table_child(pnanovdb_grid_type_t grid_type, pnanovdb_buf_t buf, pnanovdb_upper_handle_t node, pnanovdb_uint32_t n, pnanovdb_int64_t child)
Definition: PNanoVDB.h:2288
pnanovdb_leaf_handle_t leaf
Definition: PNanoVDB.h:2509
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:1778
pnanovdb_address_t address
Definition: PNanoVDB.h:1021
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:2680
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:1707
Definition: PNanoVDB.h:1576
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_leaf_indexmask_has_stats(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:1885
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:2888
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:2900
#define PNANOVDB_GRID_TYPE_FLOAT
Definition: PNanoVDB.h:940
pnanovdb_uint32_t lower_off_table
Definition: PNanoVDB.h:1630
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_world_bbox(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t index, double world_bbox)
Definition: PNanoVDB.h:1198
#define PNANOVDB_GRIDBLINDMETADATA_OFF_NAME
Definition: PNanoVDB.h:1257
#define PNANOVDB_GRIDBLINDMETADATA_SIZE
Definition: PNanoVDB.h:1249
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:1810
pnanovdb_uint32_t table_size
Definition: PNanoVDB.h:1385
MatType scale(const Vec3< typename MatType::value_type > &s)
Return a matrix that scales by s.
Definition: Mat.h:615
PNANOVDB_FORCE_INLINE float pnanovdb_map_get_matf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1035
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:1493
PNANOVDB_FORCE_INLINE void pnanovdb_write_uint64(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_uint64_t value)
Definition: PNanoVDB.h:896
PNANOVDB_FORCE_INLINE void pnanovdb_write_uint32(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_uint32_t value)
Definition: PNanoVDB.h:892
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_leaf_type[27]
Definition: PNanoVDB.h:1007
#define PNANOVDB_GRIDBLINDMETADATA_OFF_DATA_OFFSET
Definition: PNanoVDB.h:1251
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_node_count_leaf(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint32_t node_count_leaf)
Definition: PNanoVDB.h:1359
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_voxel_size(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t index, double voxel_size)
Definition: PNanoVDB.h:1201
PNANOVDB_FORCE_INLINE void pnanovdb_lower_set_bbox_min(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p, PNANOVDB_IN(pnanovdb_coord_t) bbox_min)
Definition: PNanoVDB.h:1553
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_grid_get_checksum(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1129
#define PNANOVDB_LEAF_TABLE_NEG_OFF_BBOX_DIF_AND_FLAGS
Definition: PNanoVDB.h:1586
#define PNANOVDB_GRID_OFF_GRID_TYPE
Definition: PNanoVDB.h:1122
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_pointindex_get_last(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t i)
Definition: PNanoVDB.h:2099
#define PNANOVDB_LOWER_OFF_BBOX_MIN
Definition: PNanoVDB.h:1529
Definition: PNanoVDB.h:1390
pnanovdb_address_t address
Definition: PNanoVDB.h:1468
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:2158
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindex_get_max_index(pnanovdb_buf_t buf, pnanovdb_address_t max_address)
Definition: PNanoVDB.h:1967
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_voxel_count(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint64_t voxel_count)
Definition: PNanoVDB.h:1377
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:2655
PNANOVDB_FORCE_INLINE void pnanovdb_write_int64(pnanovdb_buf_t buf, pnanovdb_address_t address, pnanovdb_int64_t value)
Definition: PNanoVDB.h:904
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_version(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t version)
Definition: PNanoVDB.h:1180
#define PNANOVDB_LEAF_TABLE_NEG_OFF_MINIMUM
Definition: PNanoVDB.h:1587
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindexmask_get_dev_index(pnanovdb_buf_t buf, pnanovdb_address_t dev_address)
Definition: PNanoVDB.h:2051
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_uint64_to_uint32_lsr(pnanovdb_uint64_t a, pnanovdb_uint32_t b)
Definition: PNanoVDB.h:644
#define PNANOVDB_GRID_OFF_VERSION
Definition: PNanoVDB.h:1112
pnanovdb_uint32_t leaf_off_table
Definition: PNanoVDB.h:1636
pnanovdb_coord_t bbox_min
Definition: PNanoVDB.h:1459
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_root_tile_get_state(pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t p)
Definition: PNanoVDB.h:1443
pnanovdb_uint32_t root_off_background
Definition: PNanoVDB.h:1610
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_lower_get_bbox_min(pnanovdb_buf_t buf, pnanovdb_lower_handle_t p)
Definition: PNanoVDB.h:1535
PNANOVDB_FORCE_INLINE pnanovdb_int32_t pnanovdb_read_int32(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:800
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_version(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1132
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:2228
Definition: PNanoVDB.h:1105
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:2785
Definition: PNanoVDB.h:1021
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:2376
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_node_offset_upper(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint64_t node_offset_upper)
Definition: PNanoVDB.h:1353
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_tree_get_node_count_upper(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1331
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:1489
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_leaf_index_has_stats(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:1851
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:2296
pnanovdb_uint32_t upper_off_stddev
Definition: PNanoVDB.h:1623
#define PNANOVDB_GRIDBLINDMETADATA_OFF_VALUE_SIZE
Definition: PNanoVDB.h:1253
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:2234
PNANOVDB_FORCE_INLINE void pnanovdb_map_set_invmatf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index, float invmatf)
Definition: PNanoVDB.h:1063
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_gridblindmetadata_get_data_offset(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:1259
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_pointindex_get_first(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t i)
Definition: PNanoVDB.h:2094
#define PNANOVDB_ROOT_TILE_OFF_CHILD
Definition: PNanoVDB.h:1434
PNANOVDB_FORCE_INLINE void pnanovdb_upper_set_bbox_max(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p, PNANOVDB_IN(pnanovdb_coord_t) bbox_max)
Definition: PNanoVDB.h:1501
PNANOVDB_FORCE_INLINE pnanovdb_vec3_t pnanovdb_read_vec3(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:824
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_indexmask_get_dev_index(pnanovdb_buf_t buf, pnanovdb_address_t dev_address)
Definition: PNanoVDB.h:1901
pnanovdb_uint32_t root_tile_off_value
Definition: PNanoVDB.h:1618
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:1158
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_indexmask_get_max_index(pnanovdb_buf_t buf, pnanovdb_address_t max_address)
Definition: PNanoVDB.h:1893
PNANOVDB_FORCE_INLINE void pnanovdb_leaf_pointindex_set_value_only(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t i, pnanovdb_uint32_t value)
Definition: PNanoVDB.h:2108
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_node_count_lower(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint32_t node_count_lower)
Definition: PNanoVDB.h:1362
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_leaf_onindexmask_has_stats(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:2035
#define PNANOVDB_LEAF_OFF_VALUE_MASK
Definition: PNanoVDB.h:1584
PNANOVDB_FORCE_INLINE void pnanovdb_leaf_set_bbox_dif_and_flags(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t p, pnanovdb_uint32_t bbox_dif_and_flags)
Definition: PNanoVDB.h:1604
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_read_uint16(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:833
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindex_get_value_index(pnanovdb_buf_t buf, pnanovdb_address_t value_address, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:2000
#define PNANOVDB_GRID_OFF_BLIND_METADATA_OFFSET
Definition: PNanoVDB.h:1123
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_table_strides_bits[27]
Definition: PNanoVDB.h:999
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_node_offset_root(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1322
pnanovdb_uint32_t tile_count_upper
Definition: PNanoVDB.h:1292
Definition: PNanoVDB.h:1457
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_pointindex_get_point_count(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:2090
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:1836
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_leaf_onindex_get_value_count(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:1936
pnanovdb_uint64_t node_offset_leaf
Definition: PNanoVDB.h:1283
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:2354
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_uint64_offset(pnanovdb_uint64_t a, pnanovdb_uint32_t b)
Definition: PNanoVDB.h:634
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:2252
pnanovdb_uint32_t tile_count_leaf
Definition: PNanoVDB.h:1290
#define PNANOVDB_MAP_OFF_VECD
Definition: PNanoVDB.h:1032
#define PNANOVDB_ROOT_OFF_TABLE_SIZE
Definition: PNanoVDB.h:1397
pnanovdb_uint64_t node_offset_root
Definition: PNanoVDB.h:1286
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:1596
#define PNANOVDB_TREE_OFF_NODE_COUNT_LOWER
Definition: PNanoVDB.h:1306
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_magic(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint64_t magic)
Definition: PNanoVDB.h:1174
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_gridblindmetadata_get_data_class(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:1271
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:2265
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_uint64_bit_mask(pnanovdb_uint32_t bit_idx)
Definition: PNanoVDB.h:649
PNANOVDB_STATIC_CONST pnanovdb_uint32_t pnanovdb_grid_type_minmax_aligns_bits[27]
Definition: PNanoVDB.h:1003
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_leaf_onindex_has_stats(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:1951
Definition: PNanoVDB.h:1468
PNANOVDB_FORCE_INLINE pnanovdb_coord_t pnanovdb_root_get_bbox_min(pnanovdb_buf_t buf, pnanovdb_root_handle_t p)
Definition: PNanoVDB.h:1399
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:2625
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:2827
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_root_index_get_value_index(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
Definition: PNanoVDB.h:2418
pnanovdb_uint32_t upper_off_ave
Definition: PNanoVDB.h:1622
#define PNANOVDB_LEAF_TABLE_NEG_OFF_QUANTUM
Definition: PNanoVDB.h:1588
pnanovdb_uint32_t root_off_min
Definition: PNanoVDB.h:1611
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_indexmask_get_value_index(pnanovdb_buf_t buf, pnanovdb_address_t value_address, PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1905
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_upper_coord_to_offset(PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:2215
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:2246
pnanovdb_coord_t bbox_min
Definition: PNanoVDB.h:1383
PNANOVDB_FORCE_INLINE void pnanovdb_map_set_vecf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index, float vecf)
Definition: PNanoVDB.h:1066
#define PNANOVDB_TREE_OFF_NODE_COUNT_UPPER
Definition: PNanoVDB.h:1307
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_root_onindex_get_value_index(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) ijk, pnanovdb_uint32_t level)
Definition: PNanoVDB.h:2432
PNANOVDB_FORCE_INLINE float pnanovdb_map_get_taperf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1044
pnanovdb_address_t address
Definition: PNanoVDB.h:1576
PNANOVDB_FORCE_INLINE void pnanovdb_upper_set_bbox_min(pnanovdb_buf_t buf, pnanovdb_upper_handle_t p, PNANOVDB_IN(pnanovdb_coord_t) bbox_min)
Definition: PNanoVDB.h:1498
#define PNANOVDB_GRID_OFF_GRID_CLASS
Definition: PNanoVDB.h:1121
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_grid_size(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint64_t grid_size)
Definition: PNanoVDB.h:1192
#define PNANOVDB_GRID_TYPE_ONINDEX
Definition: PNanoVDB.h:959
PNANOVDB_FORCE_INLINE void pnanovdb_write_float(pnanovdb_buf_t buf, pnanovdb_address_t address, float value)
Definition: PNanoVDB.h:908
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:1277
#define PNANOVDB_MAP_OFF_MATD
Definition: PNanoVDB.h:1030
PNANOVDB_FORCE_INLINE void pnanovdb_leaf_pointindex_set_on(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t i)
Definition: PNanoVDB.h:2122
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:2942
#define PNANOVDB_GRID_OFF_GRID_NAME
Definition: PNanoVDB.h:1117
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_tile_count_leaf(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint32_t tile_count_leaf)
Definition: PNanoVDB.h:1368
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_blind_metadata_count(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1170
PNANOVDB_FORCE_INLINE void pnanovdb_map_set_vecd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index, double vecd)
Definition: PNanoVDB.h:1078
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindex_get_last_offset(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf)
Definition: PNanoVDB.h:1944
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_gridblindmetadata_get_semantic(pnanovdb_buf_t buf, pnanovdb_gridblindmetadata_handle_t p)
Definition: PNanoVDB.h:1268
PNANOVDB_FORCE_INLINE float pnanovdb_map_get_invmatf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1038
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:1544
pnanovdb_uint32_t leaf_off_stddev
Definition: PNanoVDB.h:1635
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_root_tile_get_child(pnanovdb_buf_t buf, pnanovdb_root_tile_handle_t p)
Definition: PNanoVDB.h:1440
pnanovdb_uint32_t tile_count_lower
Definition: PNanoVDB.h:1291
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:1772
#define PNANOVDB_GRID_OFF_MAP
Definition: PNanoVDB.h:1118
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_uint64_and(pnanovdb_uint64_t a, pnanovdb_uint64_t b)
Definition: PNanoVDB.h:654
PNANOVDB_FORCE_INLINE double pnanovdb_read_double(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:812
#define PNANOVDB_TREE_OFF_NODE_OFFSET_UPPER
Definition: PNanoVDB.h:1303
pnanovdb_coord_t bbox_max
Definition: PNanoVDB.h:1384
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:2649
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_grid_get_grid_size(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1144
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:2348
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:1593
Definition: PNanoVDB.h:1009
PNANOVDB_FORCE_INLINE void pnanovdb_write_coord(pnanovdb_buf_t buf, pnanovdb_address_t address, PNANOVDB_IN(pnanovdb_coord_t) value)
Definition: PNanoVDB.h:916
pnanovdb_uint64_t magic
Definition: PNanoVDB.h:1087
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:1790
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_blind_metadata_count(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t metadata_count)
Definition: PNanoVDB.h:1213
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_grid_type(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t grid_type)
Definition: PNanoVDB.h:1207
pnanovdb_uint32_t node_count_upper
Definition: PNanoVDB.h:1289
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_grid_count(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t grid_count)
Definition: PNanoVDB.h:1189
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_root_get_tile_count(pnanovdb_buf_t buf, pnanovdb_root_handle_t p)
Definition: PNanoVDB.h:1405
pnanovdb_uint32_t lower_off_stddev
Definition: PNanoVDB.h:1629
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_make_version(pnanovdb_uint32_t major, pnanovdb_uint32_t minor, pnanovdb_uint32_t patch_num)
Definition: PNanoVDB.h:1217
#define PNANOVDB_GRID_OFF_CHECKSUM
Definition: PNanoVDB.h:1111
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_index_get_max_index(pnanovdb_buf_t buf, pnanovdb_address_t max_address)
Definition: PNanoVDB.h:1861
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:1841
Definition: PNanoVDB.h:1512
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_tree_get_node_offset_lower(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p)
Definition: PNanoVDB.h:1316
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_grid_type(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1164
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:2701
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:2568
#define PNANOVDB_GRID_TYPE_POINTINDEX
Definition: PNanoVDB.h:962
PNANOVDB_FORCE_INLINE void pnanovdb_leaf_set_bbox_min(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t p, PNANOVDB_IN(pnanovdb_coord_t) bbox_min)
Definition: PNanoVDB.h:1601
pnanovdb_uint64_t flags
Definition: PNanoVDB.h:1461
PNANOVDB_FORCE_INLINE pnanovdb_map_handle_t pnanovdb_grid_get_map(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1150
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:2152
PNANOVDB_FORCE_INLINE pnanovdb_address_t pnanovdb_grid_get_gridblindmetadata_value_address(pnanovdb_buf_t buf, pnanovdb_grid_handle_t grid, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1684
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_blind_metadata_offset(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint64_t blind_metadata_offset)
Definition: PNanoVDB.h:1210
PNANOVDB_FORCE_INLINE void pnanovdb_root_set_tile_count(pnanovdb_buf_t buf, pnanovdb_root_handle_t p, pnanovdb_uint32_t tile_count)
Definition: PNanoVDB.h:1415
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:2170
PNANOVDB_STATIC_CONST float pnanovdb_dither_lut[512]
Definition: PNanoVDB.h:3031
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_onindexmask_get_min_index(pnanovdb_buf_t buf, pnanovdb_address_t min_address)
Definition: PNanoVDB.h:2039
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:2719
PNANOVDB_FORCE_INLINE void pnanovdb_readaccessor_init(PNANOVDB_INOUT(pnanovdb_readaccessor_t) acc, pnanovdb_root_handle_t root)
Definition: PNanoVDB.h:2516
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:2930
PNANOVDB_FORCE_INLINE void pnanovdb_root_set_bbox_max(pnanovdb_buf_t buf, pnanovdb_root_handle_t p, PNANOVDB_IN(pnanovdb_coord_t) bbox_max)
Definition: PNanoVDB.h:1412
pnanovdb_uint32_t pad1
Definition: PNanoVDB.h:1386
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:1722
pnanovdb_uint64_t node_offset_upper
Definition: PNanoVDB.h:1285
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_lower_coord_to_offset(PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:2139
#define PNANOVDB_GRIDBLINDMETADATA_OFF_SEMANTIC
Definition: PNanoVDB.h:1254
#define PNANOVDB_TREE_OFF_VOXEL_COUNT
Definition: PNanoVDB.h:1311
pnanovdb_coord_t bbox_max
Definition: PNanoVDB.h:1460
#define PNANOVDB_GRID_OFF_GRID_SIZE
Definition: PNanoVDB.h:1116
PNANOVDB_FORCE_INLINE void pnanovdb_map_set_matd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index, double matd)
Definition: PNanoVDB.h:1072
PNANOVDB_FORCE_INLINE double pnanovdb_map_get_matd(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1047
Definition: PNanoVDB.h:1428
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:1715
pnanovdb_uint32_t flags
Definition: PNanoVDB.h:1090
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:1802
pnanovdb_uint32_t grid_class
Definition: PNanoVDB.h:1098
Definition: PNanoVDB.h:2506
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_grid_name(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t index, pnanovdb_uint32_t grid_name)
Definition: PNanoVDB.h:1195
#define PNANOVDB_GRID_OFF_GRID_INDEX
Definition: PNanoVDB.h:1114
#define PNANOVDB_TREE_OFF_NODE_OFFSET_LEAF
Definition: PNanoVDB.h:1301
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_flags(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1135
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:1784
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:2876
PNANOVDB_FORCE_INLINE void pnanovdb_grid_set_grid_class(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p, pnanovdb_uint32_t grid_class)
Definition: PNanoVDB.h:1204
#define PNANOVDB_GRID_OFF_BLIND_METADATA_COUNT
Definition: PNanoVDB.h:1124
#define PNANOVDB_MAP_OFF_TAPERD
Definition: PNanoVDB.h:1033
#define PNANOVDB_GRID_OFF_WORLD_BBOX
Definition: PNanoVDB.h:1119
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:2326
pnanovdb_uint64_t key
Definition: PNanoVDB.h:1421
PNANOVDB_FORCE_INLINE void pnanovdb_map_set_matf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index, float matf)
Definition: PNanoVDB.h:1060
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:2912
PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_read_int64(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:808
PNANOVDB_FORCE_INLINE void pnanovdb_leaf_indexmask_set_mask_bit(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t n, pnanovdb_bool_t v)
Definition: PNanoVDB.h:1917
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:1746
pnanovdb_uint32_t leaf_off_ave
Definition: PNanoVDB.h:1634
PNANOVDB_FORCE_INLINE float pnanovdb_map_get_vecf(pnanovdb_buf_t buf, pnanovdb_map_handle_t p, pnanovdb_uint32_t index)
Definition: PNanoVDB.h:1041
pnanovdb_uint32_t root_off_ave
Definition: PNanoVDB.h:1613
pnanovdb_uint32_t lower_size
Definition: PNanoVDB.h:1631
pnanovdb_int64_t child
Definition: PNanoVDB.h:1422
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_leaf_indexmask_get_min_index(pnanovdb_buf_t buf, pnanovdb_address_t min_address)
Definition: PNanoVDB.h:1889
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_version_get_patch(pnanovdb_uint32_t version)
Definition: PNanoVDB.h:1230
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_leaf_coord_to_offset(PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1765
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:2146
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_grid_get_grid_class(pnanovdb_buf_t buf, pnanovdb_grid_handle_t p)
Definition: PNanoVDB.h:1161
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_coord_to_key(PNANOVDB_IN(pnanovdb_coord_t) ijk)
Definition: PNanoVDB.h:1729
#define PNANOVDB_MAP_OFF_INVMATF
Definition: PNanoVDB.h:1027
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:2588
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_node_offset_lower(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint64_t node_offset_lower)
Definition: PNanoVDB.h:1350
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:862
pnanovdb_uint32_t state
Definition: PNanoVDB.h:1423
double taperd
Definition: PNanoVDB.h:1018
PNANOVDB_FORCE_INLINE pnanovdb_bool_t pnanovdb_leaf_indexmask_get_mask_bit(pnanovdb_buf_t buf, pnanovdb_leaf_handle_t leaf, pnanovdb_uint32_t n)
Definition: PNanoVDB.h:1909
PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_uint64_dec(pnanovdb_uint64_t a)
Definition: PNanoVDB.h:639
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:2562
pnanovdb_root_handle_t root
Definition: PNanoVDB.h:2512
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:2320
PNANOVDB_FORCE_INLINE float pnanovdb_read_float(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:804
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:2924
PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_read_uint8(pnanovdb_buf_t buf, pnanovdb_address_t address)
Definition: PNanoVDB.h:838
PNANOVDB_FORCE_INLINE void pnanovdb_tree_set_tile_count_upper(pnanovdb_buf_t buf, pnanovdb_tree_handle_t p, pnanovdb_uint32_t tile_count_upper)
Definition: PNanoVDB.h:1374
pnanovdb_address_t address
Definition: PNanoVDB.h:1296