@pmndrs/vdb 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +137 -0
- package/LICENSE +21 -0
- package/README.md +448 -2
- package/THIRD_PARTY_NOTICES.md +147 -0
- package/dist/core/compute/atlas.d.ts +94 -0
- package/dist/core/compute/atlas.js +98 -0
- package/dist/core/compute/atlas.js.map +1 -0
- package/dist/core/compute/index.d.ts +13 -0
- package/dist/core/compute/index.js +9 -0
- package/dist/core/compute/index.js.map +1 -0
- package/dist/core/compute/pyramid.d.ts +105 -0
- package/dist/core/compute/pyramid.js +455 -0
- package/dist/core/compute/pyramid.js.map +1 -0
- package/dist/core/compute/shared.d.ts +115 -0
- package/dist/core/compute/shared.js +211 -0
- package/dist/core/compute/shared.js.map +1 -0
- package/dist/core/compute/stats.d.ts +71 -0
- package/dist/core/compute/stats.js +188 -0
- package/dist/core/compute/stats.js.map +1 -0
- package/dist/core/compute/value-transform.d.ts +23 -0
- package/dist/core/compute/value-transform.js +58 -0
- package/dist/core/compute/value-transform.js.map +1 -0
- package/dist/core/errors.d.ts +11 -0
- package/dist/core/errors.js +9 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/index.d.ts +30 -0
- package/dist/core/index.js +27 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/internal.d.ts +15 -0
- package/dist/core/internal.js +15 -0
- package/dist/core/internal.js.map +1 -0
- package/dist/core/pool/affine.d.ts +34 -0
- package/dist/core/pool/affine.js +100 -0
- package/dist/core/pool/affine.js.map +1 -0
- package/dist/core/pool/allocator.d.ts +32 -0
- package/dist/core/pool/allocator.js +81 -0
- package/dist/core/pool/allocator.js.map +1 -0
- package/dist/core/pool/image-header.d.ts +82 -0
- package/dist/core/pool/image-header.js +175 -0
- package/dist/core/pool/image-header.js.map +1 -0
- package/dist/core/pool/layout.d.ts +164 -0
- package/dist/core/pool/layout.js +267 -0
- package/dist/core/pool/layout.js.map +1 -0
- package/dist/core/pool/limits.d.ts +40 -0
- package/dist/core/pool/limits.js +79 -0
- package/dist/core/pool/limits.js.map +1 -0
- package/dist/core/pool/pool.d.ts +279 -0
- package/dist/core/pool/pool.js +953 -0
- package/dist/core/pool/pool.js.map +1 -0
- package/dist/core/source/dense.d.ts +19 -0
- package/dist/core/source/dense.js +287 -0
- package/dist/core/source/dense.js.map +1 -0
- package/dist/core/source/types.d.ts +63 -0
- package/dist/core/source/types.js +9 -0
- package/dist/core/source/types.js.map +1 -0
- package/dist/core/types.d.ts +28 -0
- package/dist/core/types.js +28 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/wgsl/api.d.ts +41 -0
- package/dist/core/wgsl/api.js +463 -0
- package/dist/core/wgsl/api.js.map +1 -0
- package/dist/core/wgsl/generate.d.ts +82 -0
- package/dist/core/wgsl/generate.js +505 -0
- package/dist/core/wgsl/generate.js.map +1 -0
- package/dist/core/wgsl/level-set.d.ts +54 -0
- package/dist/core/wgsl/level-set.js +194 -0
- package/dist/core/wgsl/level-set.js.map +1 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +14 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.js +330 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -0
- package/dist/core/wgsl/reserved.d.ts +9 -0
- package/dist/core/wgsl/reserved.js +26 -0
- package/dist/core/wgsl/reserved.js.map +1 -0
- package/dist/core/wgsl/types.d.ts +104 -0
- package/dist/core/wgsl/types.js +2 -0
- package/dist/core/wgsl/types.js.map +1 -0
- package/dist/three/coarse-first.d.ts +162 -0
- package/dist/three/coarse-first.js +187 -0
- package/dist/three/coarse-first.js.map +1 -0
- package/dist/three/compute.d.ts +63 -0
- package/dist/three/compute.js +56 -0
- package/dist/three/compute.js.map +1 -0
- package/dist/three/device.d.ts +59 -0
- package/dist/three/device.js +59 -0
- package/dist/three/device.js.map +1 -0
- package/dist/three/frame/blackbody.d.ts +42 -0
- package/dist/three/frame/blackbody.js +74 -0
- package/dist/three/frame/blackbody.js.map +1 -0
- package/dist/three/frame/chunks.d.ts +157 -0
- package/dist/three/frame/chunks.js +559 -0
- package/dist/three/frame/chunks.js.map +1 -0
- package/dist/three/frame/density-material.d.ts +53 -0
- package/dist/three/frame/density-material.js +353 -0
- package/dist/three/frame/density-material.js.map +1 -0
- package/dist/three/frame/emission-light.d.ts +167 -0
- package/dist/three/frame/emission-light.js +655 -0
- package/dist/three/frame/emission-light.js.map +1 -0
- package/dist/three/frame/environment-grid-material.d.ts +21 -0
- package/dist/three/frame/environment-grid-material.js +184 -0
- package/dist/three/frame/environment-grid-material.js.map +1 -0
- package/dist/three/frame/environment-material.d.ts +22 -0
- package/dist/three/frame/environment-material.js +87 -0
- package/dist/three/frame/environment-material.js.map +1 -0
- package/dist/three/frame/grid-mip-material.d.ts +12 -0
- package/dist/three/frame/grid-mip-material.js +61 -0
- package/dist/three/frame/grid-mip-material.js.map +1 -0
- package/dist/three/frame/index.d.ts +39 -0
- package/dist/three/frame/index.js +35 -0
- package/dist/three/frame/index.js.map +1 -0
- package/dist/three/frame/inject-material.d.ts +56 -0
- package/dist/three/frame/inject-material.js +424 -0
- package/dist/three/frame/inject-material.js.map +1 -0
- package/dist/three/frame/integrate-material.d.ts +26 -0
- package/dist/three/frame/integrate-material.js +198 -0
- package/dist/three/frame/integrate-material.js.map +1 -0
- package/dist/three/frame/layout.d.ts +34 -0
- package/dist/three/frame/layout.js +48 -0
- package/dist/three/frame/layout.js.map +1 -0
- package/dist/three/frame/lighting-material.d.ts +41 -0
- package/dist/three/frame/lighting-material.js +257 -0
- package/dist/three/frame/lighting-material.js.map +1 -0
- package/dist/three/frame/lights.d.ts +11 -0
- package/dist/three/frame/lights.js +16 -0
- package/dist/three/frame/lights.js.map +1 -0
- package/dist/three/frame/medium.d.ts +21 -0
- package/dist/three/frame/medium.js +29 -0
- package/dist/three/frame/medium.js.map +1 -0
- package/dist/three/frame/neural.d.ts +14 -0
- package/dist/three/frame/neural.js +105 -0
- package/dist/three/frame/neural.js.map +1 -0
- package/dist/three/frame/phase.d.ts +44 -0
- package/dist/three/frame/phase.js +80 -0
- package/dist/three/frame/phase.js.map +1 -0
- package/dist/three/frame/renderer.d.ts +493 -0
- package/dist/three/frame/renderer.js +1498 -0
- package/dist/three/frame/renderer.js.map +1 -0
- package/dist/three/frame/shadow-density-material.d.ts +30 -0
- package/dist/three/frame/shadow-density-material.js +123 -0
- package/dist/three/frame/shadow-density-material.js.map +1 -0
- package/dist/three/frame/spectrum.d.ts +18 -0
- package/dist/three/frame/spectrum.js +36 -0
- package/dist/three/frame/spectrum.js.map +1 -0
- package/dist/three/frame/temporal-material.d.ts +29 -0
- package/dist/three/frame/temporal-material.js +152 -0
- package/dist/three/frame/temporal-material.js.map +1 -0
- package/dist/three/frame/three-internals.d.ts +65 -0
- package/dist/three/frame/three-internals.js +150 -0
- package/dist/three/frame/three-internals.js.map +1 -0
- package/dist/three/frame/transmittance-material.d.ts +31 -0
- package/dist/three/frame/transmittance-material.js +315 -0
- package/dist/three/frame/transmittance-material.js.map +1 -0
- package/dist/three/frame/view.d.ts +103 -0
- package/dist/three/frame/view.js +296 -0
- package/dist/three/frame/view.js.map +1 -0
- package/dist/three/frame/volume-shadow-material.d.ts +36 -0
- package/dist/three/frame/volume-shadow-material.js +128 -0
- package/dist/three/frame/volume-shadow-material.js.map +1 -0
- package/dist/three/frame/volume-shadows.d.ts +153 -0
- package/dist/three/frame/volume-shadows.js +756 -0
- package/dist/three/frame/volume-shadows.js.map +1 -0
- package/dist/three/frame/volume.d.ts +172 -0
- package/dist/three/frame/volume.js +256 -0
- package/dist/three/frame/volume.js.map +1 -0
- package/dist/three/grid-node.d.ts +196 -0
- package/dist/three/grid-node.js +510 -0
- package/dist/three/grid-node.js.map +1 -0
- package/dist/three/index.d.ts +43 -0
- package/dist/three/index.js +49 -0
- package/dist/three/index.js.map +1 -0
- package/dist/three/internal.d.ts +14 -0
- package/dist/three/internal.js +14 -0
- package/dist/three/internal.js.map +1 -0
- package/dist/three/level-set-material.d.ts +112 -0
- package/dist/three/level-set-material.js +204 -0
- package/dist/three/level-set-material.js.map +1 -0
- package/dist/three/material.d.ts +194 -0
- package/dist/three/material.js +359 -0
- package/dist/three/material.js.map +1 -0
- package/dist/three/points.d.ts +84 -0
- package/dist/three/points.js +130 -0
- package/dist/three/points.js.map +1 -0
- package/dist/three/sequence.d.ts +317 -0
- package/dist/three/sequence.js +526 -0
- package/dist/three/sequence.js.map +1 -0
- package/dist/three/sparse-source.d.ts +233 -0
- package/dist/three/sparse-source.js +876 -0
- package/dist/three/sparse-source.js.map +1 -0
- package/dist/three/volume-source.d.ts +167 -0
- package/dist/three/volume-source.js +353 -0
- package/dist/three/volume-source.js.map +1 -0
- package/dist/tools/cpu/compute.d.ts +97 -0
- package/dist/tools/cpu/compute.js +218 -0
- package/dist/tools/cpu/compute.js.map +1 -0
- package/dist/tools/cpu/level-set.d.ts +72 -0
- package/dist/tools/cpu/level-set.js +261 -0
- package/dist/tools/cpu/level-set.js.map +1 -0
- package/dist/tools/cpu/march.d.ts +206 -0
- package/dist/tools/cpu/march.js +575 -0
- package/dist/tools/cpu/march.js.map +1 -0
- package/dist/tools/cpu/probe-coords.d.ts +70 -0
- package/dist/tools/cpu/probe-coords.js +116 -0
- package/dist/tools/cpu/probe-coords.js.map +1 -0
- package/dist/tools/cpu/read-value.d.ts +31 -0
- package/dist/tools/cpu/read-value.js +336 -0
- package/dist/tools/cpu/read-value.js.map +1 -0
- package/dist/tools/cpu/sample-trilinear.d.ts +30 -0
- package/dist/tools/cpu/sample-trilinear.js +156 -0
- package/dist/tools/cpu/sample-trilinear.js.map +1 -0
- package/dist/tools/cpu/stride-tables.d.ts +56 -0
- package/dist/tools/cpu/stride-tables.generated.d.ts +1058 -0
- package/dist/tools/cpu/stride-tables.generated.js +1266 -0
- package/dist/tools/cpu/stride-tables.generated.js.map +1 -0
- package/dist/tools/cpu/stride-tables.js +78 -0
- package/dist/tools/cpu/stride-tables.js.map +1 -0
- package/dist/tools/errors.d.ts +57 -0
- package/dist/tools/errors.js +58 -0
- package/dist/tools/errors.js.map +1 -0
- package/dist/tools/frame/blackbody.d.ts +42 -0
- package/dist/tools/frame/blackbody.js +116 -0
- package/dist/tools/frame/blackbody.js.map +1 -0
- package/dist/tools/frame/emission.d.ts +128 -0
- package/dist/tools/frame/emission.js +282 -0
- package/dist/tools/frame/emission.js.map +1 -0
- package/dist/tools/frame/environment.d.ts +105 -0
- package/dist/tools/frame/environment.js +268 -0
- package/dist/tools/frame/environment.js.map +1 -0
- package/dist/tools/frame/grid.d.ts +302 -0
- package/dist/tools/frame/grid.js +703 -0
- package/dist/tools/frame/grid.js.map +1 -0
- package/dist/tools/frame/index.d.ts +136 -0
- package/dist/tools/frame/index.js +348 -0
- package/dist/tools/frame/index.js.map +1 -0
- package/dist/tools/frame/medium.d.ts +61 -0
- package/dist/tools/frame/medium.js +99 -0
- package/dist/tools/frame/medium.js.map +1 -0
- package/dist/tools/frame/mie-table.d.ts +6 -0
- package/dist/tools/frame/mie-table.js +16 -0
- package/dist/tools/frame/mie-table.js.map +1 -0
- package/dist/tools/frame/mie.d.ts +54 -0
- package/dist/tools/frame/mie.js +176 -0
- package/dist/tools/frame/mie.js.map +1 -0
- package/dist/tools/frame/neural-weights.d.ts +9 -0
- package/dist/tools/frame/neural-weights.js +245 -0
- package/dist/tools/frame/neural-weights.js.map +1 -0
- package/dist/tools/frame/neural.d.ts +80 -0
- package/dist/tools/frame/neural.js +150 -0
- package/dist/tools/frame/neural.js.map +1 -0
- package/dist/tools/frame/pyramid-layout.d.ts +38 -0
- package/dist/tools/frame/pyramid-layout.js +53 -0
- package/dist/tools/frame/pyramid-layout.js.map +1 -0
- package/dist/tools/frame/shadows.d.ts +80 -0
- package/dist/tools/frame/shadows.js +182 -0
- package/dist/tools/frame/shadows.js.map +1 -0
- package/dist/tools/frame/sparse.d.ts +65 -0
- package/dist/tools/frame/sparse.js +191 -0
- package/dist/tools/frame/sparse.js.map +1 -0
- package/dist/tools/frame/spectral.d.ts +203 -0
- package/dist/tools/frame/spectral.js +550 -0
- package/dist/tools/frame/spectral.js.map +1 -0
- package/dist/tools/index.d.ts +106 -0
- package/dist/tools/index.js +88 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/internal.d.ts +46 -0
- package/dist/tools/internal.js +31 -0
- package/dist/tools/internal.js.map +1 -0
- package/dist/tools/nanovdb/build-from-vdb.d.ts +50 -0
- package/dist/tools/nanovdb/build-from-vdb.js +92 -0
- package/dist/tools/nanovdb/build-from-vdb.js.map +1 -0
- package/dist/tools/nanovdb/bytes.d.ts +220 -0
- package/dist/tools/nanovdb/bytes.js +345 -0
- package/dist/tools/nanovdb/bytes.js.map +1 -0
- package/dist/tools/nanovdb/coarse-first.d.ts +62 -0
- package/dist/tools/nanovdb/coarse-first.js +86 -0
- package/dist/tools/nanovdb/coarse-first.js.map +1 -0
- package/dist/tools/nanovdb/index.d.ts +32 -0
- package/dist/tools/nanovdb/index.js +24 -0
- package/dist/tools/nanovdb/index.js.map +1 -0
- package/dist/tools/nanovdb/inspect.d.ts +24 -0
- package/dist/tools/nanovdb/inspect.js +63 -0
- package/dist/tools/nanovdb/inspect.js.map +1 -0
- package/dist/tools/nanovdb/leaf-codec.d.ts +85 -0
- package/dist/tools/nanovdb/leaf-codec.js +320 -0
- package/dist/tools/nanovdb/leaf-codec.js.map +1 -0
- package/dist/tools/nanovdb/quantize.d.ts +43 -0
- package/dist/tools/nanovdb/quantize.js +277 -0
- package/dist/tools/nanovdb/quantize.js.map +1 -0
- package/dist/tools/nanovdb/resample.d.ts +160 -0
- package/dist/tools/nanovdb/resample.js +679 -0
- package/dist/tools/nanovdb/resample.js.map +1 -0
- package/dist/tools/nanovdb/serialize.d.ts +145 -0
- package/dist/tools/nanovdb/serialize.js +395 -0
- package/dist/tools/nanovdb/serialize.js.map +1 -0
- package/dist/tools/nanovdb/stats.d.ts +58 -0
- package/dist/tools/nanovdb/stats.js +149 -0
- package/dist/tools/nanovdb/stats.js.map +1 -0
- package/dist/tools/nanovdb/transform.d.ts +26 -0
- package/dist/tools/nanovdb/transform.js +91 -0
- package/dist/tools/nanovdb/transform.js.map +1 -0
- package/dist/tools/nanovdb/tree.d.ts +175 -0
- package/dist/tools/nanovdb/tree.js +518 -0
- package/dist/tools/nanovdb/tree.js.map +1 -0
- package/dist/tools/nanovdb/write-nvdb.d.ts +39 -0
- package/dist/tools/nanovdb/write-nvdb.js +210 -0
- package/dist/tools/nanovdb/write-nvdb.js.map +1 -0
- package/dist/tools/nvdb-file.d.ts +195 -0
- package/dist/tools/nvdb-file.js +606 -0
- package/dist/tools/nvdb-file.js.map +1 -0
- package/dist/tools/nvdb-stream.d.ts +138 -0
- package/dist/tools/nvdb-stream.js +365 -0
- package/dist/tools/nvdb-stream.js.map +1 -0
- package/dist/tools/vdb/bit-utils.d.ts +20 -0
- package/dist/tools/vdb/bit-utils.js +42 -0
- package/dist/tools/vdb/bit-utils.js.map +1 -0
- package/dist/tools/vdb/blosc.d.ts +56 -0
- package/dist/tools/vdb/blosc.js +231 -0
- package/dist/tools/vdb/blosc.js.map +1 -0
- package/dist/tools/vdb/byte-reader.d.ts +40 -0
- package/dist/tools/vdb/byte-reader.js +139 -0
- package/dist/tools/vdb/byte-reader.js.map +1 -0
- package/dist/tools/vdb/compression.d.ts +73 -0
- package/dist/tools/vdb/compression.js +249 -0
- package/dist/tools/vdb/compression.js.map +1 -0
- package/dist/tools/vdb/errors.d.ts +10 -0
- package/dist/tools/vdb/errors.js +11 -0
- package/dist/tools/vdb/errors.js.map +1 -0
- package/dist/tools/vdb/grid.d.ts +37 -0
- package/dist/tools/vdb/grid.js +147 -0
- package/dist/tools/vdb/grid.js.map +1 -0
- package/dist/tools/vdb/half-float.d.ts +9 -0
- package/dist/tools/vdb/half-float.js +24 -0
- package/dist/tools/vdb/half-float.js.map +1 -0
- package/dist/tools/vdb/index.d.ts +3 -0
- package/dist/tools/vdb/index.js +3 -0
- package/dist/tools/vdb/index.js.map +1 -0
- package/dist/tools/vdb/inflate.d.ts +24 -0
- package/dist/tools/vdb/inflate.js +334 -0
- package/dist/tools/vdb/inflate.js.map +1 -0
- package/dist/tools/vdb/metadata.d.ts +17 -0
- package/dist/tools/vdb/metadata.js +72 -0
- package/dist/tools/vdb/metadata.js.map +1 -0
- package/dist/tools/vdb/parse.d.ts +25 -0
- package/dist/tools/vdb/parse.js +171 -0
- package/dist/tools/vdb/parse.js.map +1 -0
- package/dist/tools/vdb/point-render-data.d.ts +31 -0
- package/dist/tools/vdb/point-render-data.js +57 -0
- package/dist/tools/vdb/point-render-data.js.map +1 -0
- package/dist/tools/vdb/points.d.ts +160 -0
- package/dist/tools/vdb/points.js +794 -0
- package/dist/tools/vdb/points.js.map +1 -0
- package/dist/tools/vdb/transform.d.ts +23 -0
- package/dist/tools/vdb/transform.js +54 -0
- package/dist/tools/vdb/transform.js.map +1 -0
- package/dist/tools/vdb/tree.d.ts +111 -0
- package/dist/tools/vdb/tree.js +228 -0
- package/dist/tools/vdb/tree.js.map +1 -0
- package/dist/tools/vdb/types.d.ts +138 -0
- package/dist/tools/vdb/types.js +3 -0
- package/dist/tools/vdb/types.js.map +1 -0
- package/dist/tools/wvdb/bake.d.ts +116 -0
- package/dist/tools/wvdb/bake.js +311 -0
- package/dist/tools/wvdb/bake.js.map +1 -0
- package/dist/tools/wvdb/dense.d.ts +112 -0
- package/dist/tools/wvdb/dense.js +309 -0
- package/dist/tools/wvdb/dense.js.map +1 -0
- package/dist/tools/wvdb/format.d.ts +161 -0
- package/dist/tools/wvdb/format.js +303 -0
- package/dist/tools/wvdb/format.js.map +1 -0
- package/dist/tools/wvdb/index.d.ts +13 -0
- package/dist/tools/wvdb/index.js +14 -0
- package/dist/tools/wvdb/index.js.map +1 -0
- package/dist/tools/wvdb/level-set.d.ts +48 -0
- package/dist/tools/wvdb/level-set.js +153 -0
- package/dist/tools/wvdb/level-set.js.map +1 -0
- package/dist/tools/wvdb/nanovdb.d.ts +54 -0
- package/dist/tools/wvdb/nanovdb.js +60 -0
- package/dist/tools/wvdb/nanovdb.js.map +1 -0
- package/dist/tools/wvdb/read.d.ts +260 -0
- package/dist/tools/wvdb/read.js +743 -0
- package/dist/tools/wvdb/read.js.map +1 -0
- package/dist/tools/wvdb/sha256.d.ts +7 -0
- package/dist/tools/wvdb/sha256.js +76 -0
- package/dist/tools/wvdb/sha256.js.map +1 -0
- package/dist/tools/wvdb/write.d.ts +127 -0
- package/dist/tools/wvdb/write.js +396 -0
- package/dist/tools/wvdb/write.js.map +1 -0
- package/package.json +82 -4
- package/vendor/LICENSE +201 -0
- package/vendor/NOTICE +19 -0
- package/vendor/VENDOR.md +85 -0
- package/vendor/pnanovdb.wgsl +1539 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/core/pool/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAExC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,mHAAmH;AACnH,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,4BAA4B;AAC5B,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,gCAAgC;AAChC,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,CAAC,CAAC;AAE/D,mDAAmD;AACnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC,iFAAiF;AACjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,qCAAqC;AACrC,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,CAAC,CAAC;AAE/D,kCAAkC;AAClC,MAAM,CAA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CAAC;IACD,KAAK,CAAC,IAAI,CACR,yCAAyC,2BAA2B,IAAI,EACxE,yCAAyC,2BAA2B,IAAI,EACxE,wCAAwC,MAAM,CAAC,0BAA0B,CAAC,GAAG,CAC9E,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC","sourcesContent":["/**\n * Pool buffer layout 1 (docs/dev/design/K1-core.md §1): a 32-byte header, a table of\n * fixed-stride 160-byte grid records, then 32-byte-aligned ranges (NanoVDB\n * images, brick-majorant grids).\n *\n * This file is the single source of truth for every header word, record word\n * and flag bit. The TypeScript encoders below and the WGSL constants returned by\n * {@link vdbPoolLayoutWgsl} are both derived from the tables in this file, so the\n * CPU writer and the GPU reader cannot drift apart. Any change to a word or its\n * meaning bumps {@link VDB_GPU_LAYOUT_VERSION} and is a breaking change (§1.8).\n */\n\nimport type { VDBVec3 } from \"../../tools/vdb/types.js\";\nimport { VDBError } from \"../errors.js\";\n\n/** Layout version written to header word 1 and baked into generated WGSL. */\nexport const VDB_GPU_LAYOUT_VERSION = 1;\n\n/** Header word 0: `\"VDBP\"` read as a little-endian u32. */\nexport const VDB_POOL_MAGIC = 0x50424456;\n\n/** Every range in the pool (table, images, majorants) starts on this byte alignment (NanoVDB's data alignment). */\nexport const VDB_POOL_ALIGN = 32;\n\n/** Header size in bytes. */\nexport const VDB_POOL_HEADER_BYTES = 32;\n/** Header size in u32 words. */\nexport const VDB_POOL_HEADER_WORDS = VDB_POOL_HEADER_BYTES / 4;\n\n/** Byte offset of record 0 (fixed in layout 1). */\nexport const VDB_POOL_TABLE_OFFSET = 32;\n\n/** Grid record size in bytes. A multiple of 16 so `vec4` loads stay possible. */\nexport const VDB_POOL_RECORD_BYTES = 160;\n/** Grid record size in u32 words. */\nexport const VDB_POOL_RECORD_WORDS = VDB_POOL_RECORD_BYTES / 4;\n\n/** Header word indices (§1.1). */\nexport const VDB_HEADER_WORD = {\n /** {@link VDB_POOL_MAGIC}. */\n magic: 0,\n /** {@link VDB_GPU_LAYOUT_VERSION}. */\n layoutVersion: 1,\n /** Records in the table. */\n gridCapacity: 2,\n /** Highest live grid id + 1 (`vdbGridCount()` in WGSL). */\n gridCount: 3,\n /** {@link VDB_POOL_TABLE_OFFSET}, written for readers that don't know the version. */\n tableOffset: 4,\n /** {@link VDB_POOL_RECORD_BYTES}. */\n recordBytes: 5,\n /** Allocation high-water mark in bytes (diagnostics). */\n usedBytes: 6,\n /** Always 0 in layout 1. */\n reserved: 7,\n} as const;\n\n/** Grid record word indices (§1.2). Multi-word fields name their first word. */\nexport const VDB_RECORD_WORD = {\n /** u32: image byte offset from the start of the pool; a multiple of 32. */\n imageOffset: 0,\n /** u32: NanoVDB `GridData.mGridSize` (its high word must be 0). */\n imageBytes: 1,\n /** u32: NanoVDB `GridType` id (1 Float, 13 Fp4, 14 Fp8, 15 Fp16, 16 FpN). */\n gridType: 2,\n /** u32: see {@link VDB_RECORD_FLAG} and the class / brick-log2 bit fields. */\n flags: 3,\n /** f32 x12: world -> index, 3x4 row-major (`idx = M * [p, 1]`). */\n worldToIndex: 4,\n /** f32 x12: index -> world, 3x4 row-major. */\n indexToWorld: 16,\n /** i32 x3: root active bbox min. */\n indexBBoxMin: 28,\n /** f32: root background value. */\n background: 31,\n /** i32 x3: root active bbox max (inclusive). */\n indexBBoxMax: 32,\n /** f32: `max(root max stat, background)` or the caller's bound; the `global` majorant. */\n valueMax: 35,\n /** u32: brick-majorant range byte offset; 0 = none. */\n majorantOffset: 36,\n /** u32 x3: brick-majorant grid dimensions in cells. */\n majorantDims: 37,\n} as const;\n\n/** Single-bit record flags (record word 3). */\nexport const VDB_RECORD_FLAG = {\n /** b0: the record describes a live grid; a dead id reads 0 everywhere. */\n live: 1 << 0,\n /** b1: the image carries min/max stats (`GridData` flag `HasMinMax`). */\n hasStats: 1 << 1,\n /** b2: `majorantOffset`/`majorantDims` describe a brick-majorant range. */\n hasBrickMajorant: 1 << 2,\n /** b3: the affines include a host instance transform (`setTransform`). */\n instanceTransform: 1 << 3,\n} as const;\n\n/** Bit position of the 8-bit NanoVDB `GridClass` field in record word 3. */\nexport const VDB_RECORD_GRID_CLASS_SHIFT = 8;\n/** Bit position of the 8-bit brick log2 field in record word 3. */\nexport const VDB_RECORD_BRICK_LOG2_SHIFT = 16;\n/** Mask (after shifting) of the 8-bit class and brick-log2 fields. */\nexport const VDB_RECORD_BYTE_FIELD_MASK = 0xff;\n\n/** Decoded pool header (§1.1). */\nexport interface VDBPoolHeader {\n magic: number;\n layoutVersion: number;\n gridCapacity: number;\n gridCount: number;\n tableOffset: number;\n recordBytes: number;\n usedBytes: number;\n}\n\n// One definition, shared with `@pmndrs/vdb/tools` (D32).\nexport type { VDBVec3 };\n\n/**\n * Decoded grid record (§1.2). Affines hold the f32-rounded values the GPU sees;\n * 12 entries each, 3x4 row-major.\n */\nexport interface VDBGridRecord {\n imageOffset: number;\n imageBytes: number;\n gridType: number;\n live: boolean;\n hasStats: boolean;\n hasBrickMajorant: boolean;\n instanceTransform: boolean;\n /** NanoVDB `GridClass` id (0-255). */\n gridClass: number;\n /** log2 of the brick edge in voxels (0-255; 0 when there is no brick majorant). */\n brickLog2: number;\n worldToIndex: number[];\n indexToWorld: number[];\n indexBBoxMin: VDBVec3;\n indexBBoxMax: VDBVec3;\n background: number;\n valueMax: number;\n majorantOffset: number;\n majorantDims: VDBVec3;\n}\n\n/** Rounds `n` up to the pool alignment ({@link VDB_POOL_ALIGN}). */\nexport function align32(n: number): number {\n return Math.ceil(n / VDB_POOL_ALIGN) * VDB_POOL_ALIGN;\n}\n\n/** Byte offset of record `id`. */\nexport function recordByteOffset(id: number): number {\n return VDB_POOL_TABLE_OFFSET + id * VDB_POOL_RECORD_BYTES;\n}\n\n/** First byte after a table of `capacity` records, aligned: where ranges may start. */\nexport function dataStartOffset(capacity: number): number {\n return align32(VDB_POOL_TABLE_OFFSET + capacity * VDB_POOL_RECORD_BYTES);\n}\n\n/** Writes the header's 8 words into `out` at `wordOffset` and returns `out`. */\nexport function encodeHeader(\n header: Omit<VDBPoolHeader, \"magic\" | \"layoutVersion\" | \"tableOffset\" | \"recordBytes\">,\n out: Uint32Array = new Uint32Array(VDB_POOL_HEADER_WORDS),\n wordOffset = 0,\n): Uint32Array {\n const w = VDB_HEADER_WORD;\n out[wordOffset + w.magic] = VDB_POOL_MAGIC;\n out[wordOffset + w.layoutVersion] = VDB_GPU_LAYOUT_VERSION;\n out[wordOffset + w.gridCapacity] = header.gridCapacity;\n out[wordOffset + w.gridCount] = header.gridCount;\n out[wordOffset + w.tableOffset] = VDB_POOL_TABLE_OFFSET;\n out[wordOffset + w.recordBytes] = VDB_POOL_RECORD_BYTES;\n out[wordOffset + w.usedBytes] = header.usedBytes;\n out[wordOffset + w.reserved] = 0;\n return out;\n}\n\n/** Reads a header from `words` at `wordOffset` (no validation; see {@link VDBPoolHeader}). */\nexport function decodeHeader(words: Uint32Array, wordOffset = 0): VDBPoolHeader {\n const w = VDB_HEADER_WORD;\n const at = (i: number) => words[wordOffset + i] ?? 0;\n return {\n magic: at(w.magic),\n layoutVersion: at(w.layoutVersion),\n gridCapacity: at(w.gridCapacity),\n gridCount: at(w.gridCount),\n tableOffset: at(w.tableOffset),\n recordBytes: at(w.recordBytes),\n usedBytes: at(w.usedBytes),\n };\n}\n\nfunction views(words: Uint32Array): { f32: Float32Array; i32: Int32Array } {\n return {\n f32: new Float32Array(words.buffer, words.byteOffset, words.length),\n i32: new Int32Array(words.buffer, words.byteOffset, words.length),\n };\n}\n\nfunction byteField(name: string, value: number): number {\n if (!Number.isInteger(value) || value < 0 || value > VDB_RECORD_BYTE_FIELD_MASK) {\n throw new VDBError(\"VDB_BAD_OPTION\", `encodeRecord: ${name} must be an integer in 0..255, got ${value}.`);\n }\n return value;\n}\n\n/**\n * Writes `record` as 40 words into `out` at `wordOffset` and returns `out`.\n * Affines are rounded to f32 here; pass the f64 values you composed.\n */\nexport function encodeRecord(\n record: VDBGridRecord,\n out: Uint32Array = new Uint32Array(VDB_POOL_RECORD_WORDS),\n wordOffset = 0,\n): Uint32Array {\n if (record.worldToIndex.length !== 12 || record.indexToWorld.length !== 12) {\n throw new VDBError(\"VDB_BAD_OPTION\", \"encodeRecord: worldToIndex and indexToWorld must each have 12 entries (3x4 row-major).\");\n }\n if (out.length < wordOffset + VDB_POOL_RECORD_WORDS) {\n throw new VDBError(\n \"VDB_BAD_OPTION\",\n `encodeRecord: output has ${out.length} words; a record at word ${wordOffset} needs ${wordOffset + VDB_POOL_RECORD_WORDS}.`,\n );\n }\n const { f32, i32 } = views(out);\n const r = VDB_RECORD_WORD;\n const o = wordOffset;\n const F = VDB_RECORD_FLAG;\n let flags = 0;\n if (record.live) flags |= F.live;\n if (record.hasStats) flags |= F.hasStats;\n if (record.hasBrickMajorant) flags |= F.hasBrickMajorant;\n if (record.instanceTransform) flags |= F.instanceTransform;\n flags |= byteField(\"gridClass\", record.gridClass) << VDB_RECORD_GRID_CLASS_SHIFT;\n flags |= byteField(\"brickLog2\", record.brickLog2) << VDB_RECORD_BRICK_LOG2_SHIFT;\n\n out[o + r.imageOffset] = record.imageOffset;\n out[o + r.imageBytes] = record.imageBytes;\n out[o + r.gridType] = record.gridType;\n out[o + r.flags] = flags >>> 0;\n for (let k = 0; k < 12; k++) {\n f32[o + r.worldToIndex + k] = record.worldToIndex[k]!;\n f32[o + r.indexToWorld + k] = record.indexToWorld[k]!;\n }\n for (let k = 0; k < 3; k++) {\n i32[o + r.indexBBoxMin + k] = record.indexBBoxMin[k]!;\n i32[o + r.indexBBoxMax + k] = record.indexBBoxMax[k]!;\n out[o + r.majorantDims + k] = record.majorantDims[k]!;\n }\n f32[o + r.background] = record.background;\n f32[o + r.valueMax] = record.valueMax;\n out[o + r.majorantOffset] = record.majorantOffset;\n return out;\n}\n\n/** Reads the 40-word record at `wordOffset` of `words`. */\nexport function decodeRecord(words: Uint32Array, wordOffset = 0): VDBGridRecord {\n if (words.length < wordOffset + VDB_POOL_RECORD_WORDS) {\n throw new VDBError(\n \"VDB_BAD_OPTION\",\n `decodeRecord: input has ${words.length} words; a record at word ${wordOffset} needs ${wordOffset + VDB_POOL_RECORD_WORDS}.`,\n );\n }\n const { f32, i32 } = views(words);\n const r = VDB_RECORD_WORD;\n const o = wordOffset;\n const flags = words[o + r.flags]!;\n const F = VDB_RECORD_FLAG;\n const vec = (src: Int32Array | Uint32Array, at: number): VDBVec3 => [src[o + at]!, src[o + at + 1]!, src[o + at + 2]!];\n return {\n imageOffset: words[o + r.imageOffset]!,\n imageBytes: words[o + r.imageBytes]!,\n gridType: words[o + r.gridType]!,\n live: (flags & F.live) !== 0,\n hasStats: (flags & F.hasStats) !== 0,\n hasBrickMajorant: (flags & F.hasBrickMajorant) !== 0,\n instanceTransform: (flags & F.instanceTransform) !== 0,\n gridClass: (flags >>> VDB_RECORD_GRID_CLASS_SHIFT) & VDB_RECORD_BYTE_FIELD_MASK,\n brickLog2: (flags >>> VDB_RECORD_BRICK_LOG2_SHIFT) & VDB_RECORD_BYTE_FIELD_MASK,\n worldToIndex: Array.from(f32.subarray(o + r.worldToIndex, o + r.worldToIndex + 12)),\n indexToWorld: Array.from(f32.subarray(o + r.indexToWorld, o + r.indexToWorld + 12)),\n indexBBoxMin: vec(i32, r.indexBBoxMin),\n indexBBoxMax: vec(i32, r.indexBBoxMax),\n background: f32[o + r.background]!,\n valueMax: f32[o + r.valueMax]!,\n majorantOffset: words[o + r.majorantOffset]!,\n majorantDims: vec(words, r.majorantDims),\n };\n}\n\n/** `fooBarBaz` -> `FOO_BAR_BAZ`. */\nfunction upperSnake(name: string): string {\n return name.replace(/([a-z0-9])([A-Z])/g, \"$1_$2\").toUpperCase();\n}\n\nfunction u32Hex(n: number): string {\n return `0x${(n >>> 0).toString(16)}u`;\n}\n\n/**\n * WGSL `const` declarations for layout {@link VDB_GPU_LAYOUT_VERSION}, generated\n * from the tables in this file. Pure and deterministic: same package version,\n * same text. Every name carries the `VDB_` prefix (D10, K1-core §3.4) and no\n * comment contains a back-tick (CLAUDE.md Traps).\n *\n * Emitted names (all `u32`):\n * - `VDB_GPU_LAYOUT_VERSION`, `VDB_POOL_MAGIC`\n * - `VDB_POOL_TABLE_OFFSET` (bytes), `VDB_POOL_TABLE_WORD` (= offset / 4),\n * `VDB_POOL_RECORD_BYTES`, `VDB_POOL_RECORD_WORDS`, `VDB_POOL_ALIGN`\n * - `VDB_HEADER_<FIELD>` for every {@link VDB_HEADER_WORD} entry (word index),\n * e.g. `VDB_HEADER_GRID_COUNT = 3u`\n * - `VDB_REC_<FIELD>` for every {@link VDB_RECORD_WORD} entry (word index within\n * a record), e.g. `VDB_REC_IMAGE_OFFSET = 0u`, `VDB_REC_WORLD_TO_INDEX = 4u`\n * - `VDB_REC_FLAG_<NAME>` for every {@link VDB_RECORD_FLAG} bit, plus\n * `VDB_REC_GRID_CLASS_SHIFT`, `VDB_REC_BRICK_LOG2_SHIFT`, `VDB_REC_BYTE_FIELD_MASK`\n *\n * Word `w` of record `g` is `vdb_load(VDB_POOL_TABLE_WORD + g * VDB_POOL_RECORD_WORDS + w)`.\n */\nexport function vdbPoolLayoutWgsl(): string {\n const lines: string[] = [\n `// @pmndrs/vdb pool layout ${VDB_GPU_LAYOUT_VERSION} (generated from core/pool/layout.ts; do not edit).`,\n `const VDB_GPU_LAYOUT_VERSION: u32 = ${VDB_GPU_LAYOUT_VERSION}u;`,\n `const VDB_POOL_MAGIC: u32 = ${u32Hex(VDB_POOL_MAGIC)};`,\n `const VDB_POOL_ALIGN: u32 = ${VDB_POOL_ALIGN}u;`,\n `const VDB_POOL_TABLE_OFFSET: u32 = ${VDB_POOL_TABLE_OFFSET}u;`,\n `const VDB_POOL_TABLE_WORD: u32 = ${VDB_POOL_TABLE_OFFSET / 4}u;`,\n `const VDB_POOL_RECORD_BYTES: u32 = ${VDB_POOL_RECORD_BYTES}u;`,\n `const VDB_POOL_RECORD_WORDS: u32 = ${VDB_POOL_RECORD_WORDS}u;`,\n ];\n for (const [name, word] of Object.entries(VDB_HEADER_WORD)) {\n lines.push(`const VDB_HEADER_${upperSnake(name)}: u32 = ${word}u;`);\n }\n for (const [name, word] of Object.entries(VDB_RECORD_WORD)) {\n lines.push(`const VDB_REC_${upperSnake(name)}: u32 = ${word}u;`);\n }\n for (const [name, bit] of Object.entries(VDB_RECORD_FLAG)) {\n lines.push(`const VDB_REC_FLAG_${upperSnake(name)}: u32 = ${u32Hex(bit)};`);\n }\n lines.push(\n `const VDB_REC_GRID_CLASS_SHIFT: u32 = ${VDB_RECORD_GRID_CLASS_SHIFT}u;`,\n `const VDB_REC_BRICK_LOG2_SHIFT: u32 = ${VDB_RECORD_BRICK_LOG2_SHIFT}u;`,\n `const VDB_REC_BYTE_FIELD_MASK: u32 = ${u32Hex(VDB_RECORD_BYTE_FIELD_MASK)};`,\n );\n return lines.join(\"\\n\") + \"\\n\";\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device checks and size limits for the pool (docs/dev/design/K1-core.md §1.5).
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* `GPUBufferUsage` bits, restated as numbers so the core runs where the WebGPU
|
|
6
|
+
* globals don't exist (Node tests, workers before a device). Values from the
|
|
7
|
+
* WebGPU spec.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BUFFER_USAGE: {
|
|
10
|
+
readonly MAP_READ: 1;
|
|
11
|
+
readonly COPY_SRC: 4;
|
|
12
|
+
readonly COPY_DST: 8;
|
|
13
|
+
readonly STORAGE: 128;
|
|
14
|
+
};
|
|
15
|
+
/** Usage flags every pool-owned buffer has. */
|
|
16
|
+
export declare const POOL_BUFFER_USAGE: number;
|
|
17
|
+
/** Largest pool the 32-bit image addressing allows (§2), rounded down to the 32 B alignment. */
|
|
18
|
+
export declare const ADDRESS_LIMIT_BYTES: number;
|
|
19
|
+
/** The smallest buffer a pool can be: header + a one-record table, rounded to 32 B. */
|
|
20
|
+
export declare const MIN_POOL_BYTES = 256;
|
|
21
|
+
/** Starts tracking `device.lost` so later checks can report a lost device synchronously. */
|
|
22
|
+
export declare function watchDevice(device: GPUDevice): void;
|
|
23
|
+
/** True once a watched device has reported loss. */
|
|
24
|
+
export declare function isDeviceLost(device: GPUDevice): boolean;
|
|
25
|
+
/** Largest pool buffer `device` can bind, clamped to the 32-bit addressing limit. */
|
|
26
|
+
export declare function deviceByteLimit(device: GPUDevice): number;
|
|
27
|
+
/** Rounds down to a multiple of 32. */
|
|
28
|
+
export declare function floor32(n: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* Why `device` can't hold a pool, or `null` when it can. Messages name the fix.
|
|
31
|
+
* Checks: a device object with limits, not lost (tracked once the core has seen
|
|
32
|
+
* the device), at least one storage buffer per stage, and room for a minimal pool.
|
|
33
|
+
*/
|
|
34
|
+
export declare function unsupportedReason(device: GPUDevice | null | undefined): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* The limits to pass to `adapter.requestDevice({ requiredLimits })` so the pool
|
|
37
|
+
* can grow as far as the adapter allows: the adapter's maxima for
|
|
38
|
+
* `maxStorageBufferBindingSize` and `maxBufferSize`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function requiredLimits(adapter: GPUAdapter): Record<string, number>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device checks and size limits for the pool (docs/dev/design/K1-core.md §1.5).
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* `GPUBufferUsage` bits, restated as numbers so the core runs where the WebGPU
|
|
6
|
+
* globals don't exist (Node tests, workers before a device). Values from the
|
|
7
|
+
* WebGPU spec.
|
|
8
|
+
*/
|
|
9
|
+
export const BUFFER_USAGE = {
|
|
10
|
+
MAP_READ: 0x0001,
|
|
11
|
+
COPY_SRC: 0x0004,
|
|
12
|
+
COPY_DST: 0x0008,
|
|
13
|
+
STORAGE: 0x0080,
|
|
14
|
+
};
|
|
15
|
+
/** Usage flags every pool-owned buffer has. */
|
|
16
|
+
export const POOL_BUFFER_USAGE = BUFFER_USAGE.STORAGE | BUFFER_USAGE.COPY_DST | BUFFER_USAGE.COPY_SRC;
|
|
17
|
+
/** Largest pool the 32-bit image addressing allows (§2), rounded down to the 32 B alignment. */
|
|
18
|
+
export const ADDRESS_LIMIT_BYTES = 2 ** 32 - 32;
|
|
19
|
+
/** The smallest buffer a pool can be: header + a one-record table, rounded to 32 B. */
|
|
20
|
+
export const MIN_POOL_BYTES = 256;
|
|
21
|
+
const lostDevices = new WeakSet();
|
|
22
|
+
const watchedDevices = new WeakSet();
|
|
23
|
+
/** Starts tracking `device.lost` so later checks can report a lost device synchronously. */
|
|
24
|
+
export function watchDevice(device) {
|
|
25
|
+
if (watchedDevices.has(device))
|
|
26
|
+
return;
|
|
27
|
+
watchedDevices.add(device);
|
|
28
|
+
const lost = device.lost;
|
|
29
|
+
void lost?.then(() => lostDevices.add(device));
|
|
30
|
+
}
|
|
31
|
+
/** True once a watched device has reported loss. */
|
|
32
|
+
export function isDeviceLost(device) {
|
|
33
|
+
return lostDevices.has(device);
|
|
34
|
+
}
|
|
35
|
+
/** Largest pool buffer `device` can bind, clamped to the 32-bit addressing limit. */
|
|
36
|
+
export function deviceByteLimit(device) {
|
|
37
|
+
const { maxStorageBufferBindingSize, maxBufferSize } = device.limits;
|
|
38
|
+
return floor32(Math.min(maxStorageBufferBindingSize, maxBufferSize, ADDRESS_LIMIT_BYTES));
|
|
39
|
+
}
|
|
40
|
+
/** Rounds down to a multiple of 32. */
|
|
41
|
+
export function floor32(n) {
|
|
42
|
+
return Math.floor(n / 32) * 32;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Why `device` can't hold a pool, or `null` when it can. Messages name the fix.
|
|
46
|
+
* Checks: a device object with limits, not lost (tracked once the core has seen
|
|
47
|
+
* the device), at least one storage buffer per stage, and room for a minimal pool.
|
|
48
|
+
*/
|
|
49
|
+
export function unsupportedReason(device) {
|
|
50
|
+
if (!device)
|
|
51
|
+
return "No GPUDevice was passed. Request one with adapter.requestDevice() and pass it in.";
|
|
52
|
+
const limits = device.limits;
|
|
53
|
+
if (!limits)
|
|
54
|
+
return "The object passed as a GPUDevice has no limits. Pass a real GPUDevice.";
|
|
55
|
+
if (isDeviceLost(device))
|
|
56
|
+
return "The GPUDevice was lost. Request a new device and create a new pool on it.";
|
|
57
|
+
if (!(limits.maxStorageBuffersPerShaderStage >= 1)) {
|
|
58
|
+
return (`The device allows ${limits.maxStorageBuffersPerShaderStage} storage buffers per shader stage; the pool needs 1. ` +
|
|
59
|
+
`Request a core (non-compatibility) device.`);
|
|
60
|
+
}
|
|
61
|
+
const limit = deviceByteLimit(device);
|
|
62
|
+
if (limit < MIN_POOL_BYTES) {
|
|
63
|
+
return (`The device can bind storage buffers of ${limit} bytes; the pool needs at least ${MIN_POOL_BYTES}. ` +
|
|
64
|
+
`Request the device with VDBGridPool.requiredLimits(adapter).`);
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The limits to pass to `adapter.requestDevice({ requiredLimits })` so the pool
|
|
70
|
+
* can grow as far as the adapter allows: the adapter's maxima for
|
|
71
|
+
* `maxStorageBufferBindingSize` and `maxBufferSize`.
|
|
72
|
+
*/
|
|
73
|
+
export function requiredLimits(adapter) {
|
|
74
|
+
return {
|
|
75
|
+
maxStorageBufferBindingSize: adapter.limits.maxStorageBufferBindingSize,
|
|
76
|
+
maxBufferSize: adapter.limits.maxBufferSize,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../src/core/pool/limits.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;IAChB,OAAO,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AED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAoC;IACpE,IAAI,CAAC,MAAM;QAAE,OAAO,mFAAmF,CAAC;IACxG,MAAM,MAAM,GAAG,MAAM,CAAC,MAAwC,CAAC;IAC/D,IAAI,CAAC,MAAM;QAAE,OAAO,wEAAwE,CAAC;IAC7F,IAAI,YAAY,CAAC,MAAM,CAAC;QAAE,OAAO,2EAA2E,CAAC;IAC7G,IAAI,CAAC,CAAC,MAAM,CAAC,+BAA+B,IAAI,CAAC,CAAC,EAAE,CAAC;QACnD,OAAO,CACL,qBAAqB,MAAM,CAAC,+BAA+B,uDAAuD;YAClH,4CAA4C,CAC7C,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,KAAK,GAAG,cAAc,EAAE,CAAC;QAC3B,OAAO,CACL,0CAA0C,KAAK,mCAAmC,cAAc,IAAI;YACpG,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAmB;IAChD,OAAO;QACL,2BAA2B,EAAE,OAAO,CAAC,MAAM,CAAC,2BAA2B;QACvE,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa;KAC5C,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Device checks and size limits for the pool (docs/dev/design/K1-core.md §1.5).\n */\n\n/**\n * `GPUBufferUsage` bits, restated as numbers so the core runs where the WebGPU\n * globals don't exist (Node tests, workers before a device). Values from the\n * WebGPU spec.\n */\nexport const BUFFER_USAGE = {\n MAP_READ: 0x0001,\n COPY_SRC: 0x0004,\n COPY_DST: 0x0008,\n STORAGE: 0x0080,\n} as const;\n\n/** Usage flags every pool-owned buffer has. */\nexport const POOL_BUFFER_USAGE = BUFFER_USAGE.STORAGE | BUFFER_USAGE.COPY_DST | BUFFER_USAGE.COPY_SRC;\n\n/** Largest pool the 32-bit image addressing allows (§2), rounded down to the 32 B alignment. */\nexport const ADDRESS_LIMIT_BYTES = 2 ** 32 - 32;\n\n/** The smallest buffer a pool can be: header + a one-record table, rounded to 32 B. */\nexport const MIN_POOL_BYTES = 256;\n\nconst lostDevices = new WeakSet<GPUDevice>();\nconst watchedDevices = new WeakSet<GPUDevice>();\n\n/** Starts tracking `device.lost` so later checks can report a lost device synchronously. */\nexport function watchDevice(device: GPUDevice): void {\n if (watchedDevices.has(device)) return;\n watchedDevices.add(device);\n const lost: Promise<GPUDeviceLostInfo> | undefined = device.lost;\n void lost?.then(() => lostDevices.add(device));\n}\n\n/** True once a watched device has reported loss. */\nexport function isDeviceLost(device: GPUDevice): boolean {\n return lostDevices.has(device);\n}\n\n/** Largest pool buffer `device` can bind, clamped to the 32-bit addressing limit. */\nexport function deviceByteLimit(device: GPUDevice): number {\n const { maxStorageBufferBindingSize, maxBufferSize } = device.limits;\n return floor32(Math.min(maxStorageBufferBindingSize, maxBufferSize, ADDRESS_LIMIT_BYTES));\n}\n\n/** Rounds down to a multiple of 32. */\nexport function floor32(n: number): number {\n return Math.floor(n / 32) * 32;\n}\n\n/**\n * Why `device` can't hold a pool, or `null` when it can. Messages name the fix.\n * Checks: a device object with limits, not lost (tracked once the core has seen\n * the device), at least one storage buffer per stage, and room for a minimal pool.\n */\nexport function unsupportedReason(device: GPUDevice | null | undefined): string | null {\n if (!device) return \"No GPUDevice was passed. Request one with adapter.requestDevice() and pass it in.\";\n const limits = device.limits as GPUSupportedLimits | undefined;\n if (!limits) return \"The object passed as a GPUDevice has no limits. Pass a real GPUDevice.\";\n if (isDeviceLost(device)) return \"The GPUDevice was lost. Request a new device and create a new pool on it.\";\n if (!(limits.maxStorageBuffersPerShaderStage >= 1)) {\n return (\n `The device allows ${limits.maxStorageBuffersPerShaderStage} storage buffers per shader stage; the pool needs 1. ` +\n `Request a core (non-compatibility) device.`\n );\n }\n const limit = deviceByteLimit(device);\n if (limit < MIN_POOL_BYTES) {\n return (\n `The device can bind storage buffers of ${limit} bytes; the pool needs at least ${MIN_POOL_BYTES}. ` +\n `Request the device with VDBGridPool.requiredLimits(adapter).`\n );\n }\n return null;\n}\n\n/**\n * The limits to pass to `adapter.requestDevice({ requiredLimits })` so the pool\n * can grow as far as the adapter allows: the adapter's maxima for\n * `maxStorageBufferBindingSize` and `maxBufferSize`.\n */\nexport function requiredLimits(adapter: GPUAdapter): Record<string, number> {\n return {\n maxStorageBufferBindingSize: adapter.limits.maxStorageBufferBindingSize,\n maxBufferSize: adapter.limits.maxBufferSize,\n };\n}\n"]}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `VDBGridPool`: many NanoVDB grids in one `GPUBuffer` behind a grid table
|
|
3
|
+
* (docs/dev/design/K1-core.md §1, §4; D8, D10).
|
|
4
|
+
*
|
|
5
|
+
* Model: CPU calls (`add`, `replace`, `remove`, `setTransform`, `setMajorant`)
|
|
6
|
+
* stage changes and return at once; `update(encoder)` applies them. Growth and
|
|
7
|
+
* compaction happen only in `update`, by a new buffer plus copies of the ranges
|
|
8
|
+
* that were resident before that update; `version` bumps then (and when a
|
|
9
|
+
* failed growth rolls back to the previous buffer).
|
|
10
|
+
*
|
|
11
|
+
* Lifecycle (docs/archive/handoffs/K1.md, "K1.3 pool lifecycle"):
|
|
12
|
+
* - A request that could never fit under the byte limit throws `VDB_POOL_LIMIT`
|
|
13
|
+
* at staging, with the pool unchanged.
|
|
14
|
+
* - Growth allocates inside `out-of-memory` and `validation` error scopes. The
|
|
15
|
+
* pool switches to the new buffer at once (update is synchronous) but keeps
|
|
16
|
+
* the old one alive until the scopes resolve; on an error it rolls back to the
|
|
17
|
+
* old buffer and reports through `settled()` / `lastError`.
|
|
18
|
+
* - A retired buffer is destroyed once its growth is confirmed, two `update`s
|
|
19
|
+
* have passed, and `queue.onSubmittedWorkDone()` asked at that point resolves.
|
|
20
|
+
*/
|
|
21
|
+
import { VDBError } from "../errors.js";
|
|
22
|
+
import type { VDBGridTypeName, VDBSlot } from "../types.js";
|
|
23
|
+
import { type VDBVec3 } from "./layout.js";
|
|
24
|
+
/**
|
|
25
|
+
* A dense grid of upper bounds over a grid's index space, one f32 per brick of
|
|
26
|
+
* `2^brickLog2` voxels per side, x fastest (§5.1). Built by `tools`; the pool
|
|
27
|
+
* only stores it.
|
|
28
|
+
*/
|
|
29
|
+
export interface VDBBrickMajorant {
|
|
30
|
+
/** log2 of the brick edge in index voxels (3 for 8³ bricks). */
|
|
31
|
+
brickLog2: number;
|
|
32
|
+
/** Cells along x, y, z. */
|
|
33
|
+
dims: readonly [number, number, number];
|
|
34
|
+
/** `dims[0] * dims[1] * dims[2]` bounds, x fastest. */
|
|
35
|
+
data: Float32Array;
|
|
36
|
+
}
|
|
37
|
+
/** A 4x4 column-major object-to-world matrix (three's `Matrix4.elements`), or `null` for the file's map. */
|
|
38
|
+
export type VDBTransformInput = Float32Array | Float64Array | readonly number[] | null;
|
|
39
|
+
/** Options for {@link VDBGridPool.create}. */
|
|
40
|
+
export interface VDBGridPoolOptions {
|
|
41
|
+
/** Initial buffer bytes (default 1 MiB); the first `update` grows it to fit. */
|
|
42
|
+
initialBytes?: number;
|
|
43
|
+
/** Initial table capacity in grids (default 16); the table doubles through the growth path. */
|
|
44
|
+
maxGrids?: number;
|
|
45
|
+
/** Upper bound on the buffer size (default: the device limit). */
|
|
46
|
+
maxBytes?: number;
|
|
47
|
+
/** Debug label for the buffers the pool creates. */
|
|
48
|
+
label?: string;
|
|
49
|
+
/** Extra `GPUBufferUsage` flags ORed into `STORAGE | COPY_DST | COPY_SRC`. */
|
|
50
|
+
usage?: number;
|
|
51
|
+
/**
|
|
52
|
+
* A host-owned buffer to use instead. It must have `STORAGE | COPY_DST`
|
|
53
|
+
* usage. The pool never destroys it and never grows it: when it is full,
|
|
54
|
+
* `add`/`replace`/`setMajorant` throw `VDB_POOL_FULL`.
|
|
55
|
+
*/
|
|
56
|
+
buffer?: GPUBuffer;
|
|
57
|
+
}
|
|
58
|
+
/** Options for {@link VDBGridPool.add}. */
|
|
59
|
+
export interface VDBAddOptions {
|
|
60
|
+
/** Bytes to reserve for the image (at least its size), so later `replace` calls fit in place. */
|
|
61
|
+
capacity?: number;
|
|
62
|
+
/** Instance transform (see {@link VDBGridPool.setTransform}). */
|
|
63
|
+
transform?: VDBTransformInput;
|
|
64
|
+
/** Brick-majorant bounds for this grid (see {@link VDBGridPool.setMajorant}). */
|
|
65
|
+
majorant?: VDBBrickMajorant;
|
|
66
|
+
/** Global density bound (record word 35); default `max(root max, background)` when the image has stats. */
|
|
67
|
+
valueMax?: number;
|
|
68
|
+
/** Free-form label, reported by `info`. */
|
|
69
|
+
label?: string;
|
|
70
|
+
}
|
|
71
|
+
/** What {@link VDBGridPool.info} reports about one grid. */
|
|
72
|
+
export interface VDBGridInfo {
|
|
73
|
+
id: number;
|
|
74
|
+
type: VDBGridTypeName;
|
|
75
|
+
/** NanoVDB `GridType` id. */
|
|
76
|
+
gridTypeId: number;
|
|
77
|
+
/** NanoVDB `GridClass` name, e.g. `"FogVolume"`. */
|
|
78
|
+
gridClass: string;
|
|
79
|
+
gridClassId: number;
|
|
80
|
+
/** Grid name from the image header. */
|
|
81
|
+
name: string;
|
|
82
|
+
label: string | undefined;
|
|
83
|
+
imageBytes: number;
|
|
84
|
+
/** Bytes reserved for the image (≥ `imageBytes`, 32 B multiple). */
|
|
85
|
+
capacity: number;
|
|
86
|
+
/** Byte offset of the image in the pool, or `null` until an `update` places it. */
|
|
87
|
+
imageOffset: number | null;
|
|
88
|
+
/** True once the image bytes are on the GPU (after the `update` that wrote them). */
|
|
89
|
+
resident: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* The pool {@link VDBGridPool.revision} at this grid's last `add` or `replace`: changes exactly
|
|
92
|
+
* when the image's contents may have (not on `setTransform` / `setMajorant`). Data derived from the
|
|
93
|
+
* image (a coarse pyramid, K3.2a) rebuilds when it moves; ids reused after `remove` get a new one.
|
|
94
|
+
*/
|
|
95
|
+
imageRevision: number;
|
|
96
|
+
hasStats: boolean;
|
|
97
|
+
hasBrickMajorant: boolean;
|
|
98
|
+
majorantOffset: number | null;
|
|
99
|
+
majorantDims: VDBVec3 | null;
|
|
100
|
+
instanceTransform: boolean;
|
|
101
|
+
background: number;
|
|
102
|
+
valueMax: number;
|
|
103
|
+
/**
|
|
104
|
+
* The root node's min/max statistics as stored in the image (f32). Meaningful
|
|
105
|
+
* only when `hasStats`; without stats they are whatever the file holds
|
|
106
|
+
* (usually 0). `gridStats` and `decodeToAtlas` use them as their range.
|
|
107
|
+
*/
|
|
108
|
+
rootMin: number;
|
|
109
|
+
rootMax: number;
|
|
110
|
+
voxelSize: VDBVec3;
|
|
111
|
+
indexBBox: {
|
|
112
|
+
min: VDBVec3;
|
|
113
|
+
max: VDBVec3;
|
|
114
|
+
};
|
|
115
|
+
/** World-space AABB of the index bbox's voxels (max corner + 1 voxel), through the record's f64 transform. */
|
|
116
|
+
worldBBox: {
|
|
117
|
+
min: VDBVec3;
|
|
118
|
+
max: VDBVec3;
|
|
119
|
+
};
|
|
120
|
+
/** f64 affines before f32 rounding, 3x4 row-major. */
|
|
121
|
+
worldToIndex: Float64Array;
|
|
122
|
+
indexToWorld: Float64Array;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Many NanoVDB grids in one storage buffer, bound at one slot (D10). The pool
|
|
126
|
+
* takes the host's `GPUDevice`, records into the host's encoder, and frees only
|
|
127
|
+
* what it allocated (D8).
|
|
128
|
+
*
|
|
129
|
+
* Images passed to `add`/`replace` are held by reference (not copied) until the
|
|
130
|
+
* next `update` writes them, and after that while a growth is unconfirmed
|
|
131
|
+
* (until `settled()` resolves); don't mutate them before then.
|
|
132
|
+
*/
|
|
133
|
+
export declare class VDBGridPool {
|
|
134
|
+
#private;
|
|
135
|
+
/** The device the pool allocates on. */
|
|
136
|
+
readonly device: GPUDevice;
|
|
137
|
+
private constructor();
|
|
138
|
+
/**
|
|
139
|
+
* Creates a pool on `device`. Throws `VDB_UNSUPPORTED_DEVICE` (see
|
|
140
|
+
* {@link unsupportedReason}) or `VDB_BAD_OPTION`. The returned pool is
|
|
141
|
+
* bindable at once (an empty table).
|
|
142
|
+
*/
|
|
143
|
+
static create(device: GPUDevice, options?: VDBGridPoolOptions): Promise<VDBGridPool>;
|
|
144
|
+
/** True when `device` can hold a pool. */
|
|
145
|
+
static isSupported(device: GPUDevice): boolean;
|
|
146
|
+
/** Why `device` can't hold a pool, or `null`. */
|
|
147
|
+
static unsupportedReason(device: GPUDevice): string | null;
|
|
148
|
+
/** Limits for `adapter.requestDevice({ requiredLimits })` so the pool can grow to the adapter's maxima. */
|
|
149
|
+
static requiredLimits(adapter: GPUAdapter): Record<string, number>;
|
|
150
|
+
/**
|
|
151
|
+
* The pool's buffer. Replaced by a growth in `update`, or by the rollback of
|
|
152
|
+
* a growth whose allocation failed (asynchronously; see `settled`); `version`
|
|
153
|
+
* changes each time.
|
|
154
|
+
*/
|
|
155
|
+
get buffer(): GPUBuffer;
|
|
156
|
+
/**
|
|
157
|
+
* +1 whenever `buffer` changes object: rebuild bind groups. Monotonic: a
|
|
158
|
+
* failed growth's rollback to the previous buffer is a new version too.
|
|
159
|
+
*
|
|
160
|
+
* Read it after `update(encoder)`: call `update(encoder)` before building
|
|
161
|
+
* or reusing bind groups this frame. A bind group built before `update()`
|
|
162
|
+
* keeps the previous (still-alive) buffer and silently misses new grids.
|
|
163
|
+
*/
|
|
164
|
+
get version(): number;
|
|
165
|
+
/** +1 on every content change (add, replace, remove, setTransform, setMajorant). */
|
|
166
|
+
get revision(): number;
|
|
167
|
+
/** {@link VDB_GPU_LAYOUT_VERSION}. */
|
|
168
|
+
get layoutVersion(): number;
|
|
169
|
+
/** Size of `buffer` in bytes. */
|
|
170
|
+
get byteLength(): number;
|
|
171
|
+
/** Allocation high-water mark in bytes (header word 6). */
|
|
172
|
+
get usedBytes(): number;
|
|
173
|
+
/** Bytes in replaced buffers still alive: awaiting growth confirmation or the queue (see `update`). */
|
|
174
|
+
get retiredBytes(): number;
|
|
175
|
+
/**
|
|
176
|
+
* The error from the last growth whose allocation failed (`VDB_POOL_LIMIT`;
|
|
177
|
+
* the pool rolled back to its previous buffer), or `null`. Cleared when a
|
|
178
|
+
* later growth is confirmed.
|
|
179
|
+
*/
|
|
180
|
+
get lastError(): VDBError | null;
|
|
181
|
+
/**
|
|
182
|
+
* Resolves once every growth started so far is confirmed by the device;
|
|
183
|
+
* rejects with the `VDB_POOL_LIMIT` error if one failed and the pool rolled
|
|
184
|
+
* back (see {@link lastError}). Resolves at once when no growth is pending.
|
|
185
|
+
*/
|
|
186
|
+
settled(): Promise<void>;
|
|
187
|
+
/** Records in the grid table. */
|
|
188
|
+
get gridCapacity(): number;
|
|
189
|
+
/** Highest live id + 1 (header word 3). */
|
|
190
|
+
get gridCount(): number;
|
|
191
|
+
/**
|
|
192
|
+
* Grid types of the live grids now, for `vdbCheckModule` and
|
|
193
|
+
* `vdbModuleWgsl({ types })`. It does not know about grids the host adds
|
|
194
|
+
* later: generate the module for every type the host may add (see `add`).
|
|
195
|
+
*/
|
|
196
|
+
get types(): ReadonlySet<VDBGridTypeName>;
|
|
197
|
+
/**
|
|
198
|
+
* Stages a grid image and returns its id at once. The image is validated
|
|
199
|
+
* here (`VDB_BAD_IMAGE`, `VDB_UNSUPPORTED_GRID_TYPE`) and written by the next
|
|
200
|
+
* `update`. Dead ids are reused, lowest first.
|
|
201
|
+
*
|
|
202
|
+
* The shader reading this pool decodes only the types its module was
|
|
203
|
+
* generated for; a grid of any other type reads as 0. A module must
|
|
204
|
+
* therefore be generated for every type the host may add (its known set,
|
|
205
|
+
* or `VDB_ALL_SCALAR_TYPES`), or regenerated and its pipeline rebuilt when
|
|
206
|
+
* a new type arrives. Call `vdbCheckModule(pool, options)` after `add` to
|
|
207
|
+
* catch a mismatch (`VDB_TYPE_NOT_COMPILED`).
|
|
208
|
+
*/
|
|
209
|
+
add(image: Uint32Array, options?: VDBAddOptions): number;
|
|
210
|
+
/**
|
|
211
|
+
* Stages a new image for grid `id`. It is written in place when it fits the
|
|
212
|
+
* grid's reserved range (no `version` change: the sequence-player path), else
|
|
213
|
+
* moved. A brick majorant set on the grid is dropped (it described the old
|
|
214
|
+
* image); call `setMajorant` again. Transform, label and `valueMax` are kept.
|
|
215
|
+
*/
|
|
216
|
+
replace(id: number, image: Uint32Array): void;
|
|
217
|
+
/** Frees grid `id`'s ranges and clears its record; the id may be reused by the next `add`. */
|
|
218
|
+
remove(id: number): void;
|
|
219
|
+
/**
|
|
220
|
+
* Sets grid `id`'s instance transform: a 4x4 column-major object-to-world
|
|
221
|
+
* matrix (WebGPU / three convention), or `null` for the file's own map. The
|
|
222
|
+
* pool composes `worldToIndex = map⁻¹ ∘ objectToWorld⁻¹` and `indexToWorld`
|
|
223
|
+
* in f64 and rounds to f32. Only the record changes; the image is untouched.
|
|
224
|
+
*/
|
|
225
|
+
setTransform(id: number, objectToWorld: VDBTransformInput): void;
|
|
226
|
+
/**
|
|
227
|
+
* Stores brick-majorant bounds for grid `id` in the pool (record words
|
|
228
|
+
* 36–39, flag b2, brick log2 in b16–23), or clears them with `null`.
|
|
229
|
+
*/
|
|
230
|
+
setMajorant(id: number, majorant: VDBBrickMajorant | null): void;
|
|
231
|
+
/** Describes grid `id`. Throws `VDB_UNKNOWN_GRID` for a dead or out-of-range id. */
|
|
232
|
+
info(id: number): VDBGridInfo;
|
|
233
|
+
/**
|
|
234
|
+
* Applies staged changes, recording any copies into `encoder`:
|
|
235
|
+
* 1. asks the queue about buffers retired at least two updates ago (once
|
|
236
|
+
* their growth is confirmed); each is destroyed when
|
|
237
|
+
* `onSubmittedWorkDone` resolves;
|
|
238
|
+
* 2. if the staged state doesn't fit, grows (or, when only fragmentation
|
|
239
|
+
* blocks a placement, compacts) into a new buffer, copying ranges that
|
|
240
|
+
* were resident before this call, and bumps `version`. The allocation is
|
|
241
|
+
* checked in error scopes; if it fails, the pool rolls back later (see
|
|
242
|
+
* {@link settled}). Planned before anything changes: when the staged
|
|
243
|
+
* grids together pass the byte limit, nothing is re-laid out;
|
|
244
|
+
* 3. writes new images, majorants, dirty records and the header with
|
|
245
|
+
* `queue.writeBuffer`, for ranges placed in the current buffer (a grid
|
|
246
|
+
* still waiting for space reads as dead on the GPU).
|
|
247
|
+
* Then, if step 2 hit the limit, throws `VDB_POOL_LIMIT` (buffer and
|
|
248
|
+
* `version` unchanged; remove grids and update again).
|
|
249
|
+
*
|
|
250
|
+
* Submit `encoder` before the second `update` after this one (one update of
|
|
251
|
+
* slack): a buffer this update retires stays alive until then.
|
|
252
|
+
*
|
|
253
|
+
* Call `update(encoder)` before building or reusing bind groups this frame,
|
|
254
|
+
* then compare `version` with the version the bind group was built at. A
|
|
255
|
+
* bind group built before `update()` keeps the previous (still-alive)
|
|
256
|
+
* buffer and silently misses new grids: no validation error, just stale
|
|
257
|
+
* data.
|
|
258
|
+
*/
|
|
259
|
+
update(encoder: GPUCommandEncoder): void;
|
|
260
|
+
/** Convenience: creates an encoder, calls `update`, and submits it. */
|
|
261
|
+
flush(): void;
|
|
262
|
+
/**
|
|
263
|
+
* The bind group entry for `slot`: `{ binding: slot.firstBinding, resource: { buffer } }`.
|
|
264
|
+
* Takes the same `VDBSlot` as `vdbModuleWgsl({ slot })` and
|
|
265
|
+
* `vdbModuleEntries(slot)`.
|
|
266
|
+
*
|
|
267
|
+
* It names the current `buffer`, so call `update(encoder)` before building
|
|
268
|
+
* or reusing bind groups this frame, and rebuild when `version` changed. A
|
|
269
|
+
* bind group built before `update()` keeps the previous (still-alive)
|
|
270
|
+
* buffer and silently misses new grids.
|
|
271
|
+
*/
|
|
272
|
+
bindGroupEntry(slot: VDBSlot): GPUBindGroupEntry;
|
|
273
|
+
/**
|
|
274
|
+
* Destroys every buffer this pool created (current, retired, and those of an
|
|
275
|
+
* unconfirmed growth) at once, never a host buffer or the device. Submit no
|
|
276
|
+
* work recorded by `update` after this. Idempotent.
|
|
277
|
+
*/
|
|
278
|
+
dispose(): void;
|
|
279
|
+
}
|