@luma.gl/engine 10.0.0-alpha.5 → 10.0.0-alpha.6
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/README.md +37 -0
- package/dist/arrow/arrow-geometry.cjs +350 -0
- package/dist/arrow/arrow-geometry.d.ts +44 -0
- package/dist/arrow/arrow-geometry.d.ts.map +1 -0
- package/dist/arrow/arrow-geometry.js +337 -0
- package/dist/arrow/arrow-geometry.js.map +1 -0
- package/dist/arrow/arrow-mesh-types.cjs +15 -0
- package/dist/arrow/arrow-mesh-types.d.ts +35 -0
- package/dist/arrow/arrow-mesh-types.d.ts.map +1 -0
- package/dist/arrow/arrow-mesh-types.js +5 -0
- package/dist/arrow/arrow-mesh-types.js.map +1 -0
- package/dist/arrow/arrow-picking.cjs +139 -0
- package/dist/arrow/arrow-picking.d.ts +66 -0
- package/dist/arrow/arrow-picking.d.ts.map +1 -0
- package/dist/arrow/arrow-picking.js +108 -0
- package/dist/arrow/arrow-picking.js.map +1 -0
- package/dist/arrow/index.cjs +222 -0
- package/dist/arrow/index.cjs.map +6 -0
- package/dist/arrow/index.d.ts +22 -0
- package/dist/arrow/index.d.ts.map +1 -0
- package/dist/arrow/index.js +24 -0
- package/dist/arrow/index.js.map +1 -0
- package/dist/arrow/renderers/arrow-renderer-utils.cjs +128 -0
- package/dist/arrow/renderers/arrow-renderer-utils.d.ts +72 -0
- package/dist/arrow/renderers/arrow-renderer-utils.d.ts.map +1 -0
- package/dist/arrow/renderers/arrow-renderer-utils.js +103 -0
- package/dist/arrow/renderers/arrow-renderer-utils.js.map +1 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-gpu-vectors.cjs +839 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-gpu-vectors.d.ts +92 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-gpu-vectors.d.ts.map +1 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-gpu-vectors.js +842 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-gpu-vectors.js.map +1 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.cjs +228 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.d.ts +17 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.d.ts.map +1 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.js +219 -0
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.js.map +1 -0
- package/dist/arrow/renderers/path/renderers/arrow-path-renderer.cjs +98 -0
- package/dist/arrow/renderers/path/renderers/arrow-path-renderer.d.ts +48 -0
- package/dist/arrow/renderers/path/renderers/arrow-path-renderer.d.ts.map +1 -0
- package/dist/arrow/renderers/path/renderers/arrow-path-renderer.js +64 -0
- package/dist/arrow/renderers/path/renderers/arrow-path-renderer.js.map +1 -0
- package/dist/arrow/renderers/path/source/arrow-path-source-mapping.cjs +98 -0
- package/dist/arrow/renderers/path/source/arrow-path-source-mapping.d.ts +41 -0
- package/dist/arrow/renderers/path/source/arrow-path-source-mapping.d.ts.map +1 -0
- package/dist/arrow/renderers/path/source/arrow-path-source-mapping.js +80 -0
- package/dist/arrow/renderers/path/source/arrow-path-source-mapping.js.map +1 -0
- package/dist/arrow/renderers/path/transforms/close-arrow-paths.cjs +557 -0
- package/dist/arrow/renderers/path/transforms/close-arrow-paths.d.ts +34 -0
- package/dist/arrow/renderers/path/transforms/close-arrow-paths.d.ts.map +1 -0
- package/dist/arrow/renderers/path/transforms/close-arrow-paths.js +550 -0
- package/dist/arrow/renderers/path/transforms/close-arrow-paths.js.map +1 -0
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.cjs +254 -0
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.d.ts +20 -0
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.d.ts.map +1 -0
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.js +228 -0
- package/dist/arrow/renderers/path/transforms/gpu-path-float64-deltas.js.map +1 -0
- package/dist/arrow/renderers/path/transforms/path-view-origins.cjs +74 -0
- package/dist/arrow/renderers/path/transforms/path-view-origins.d.ts +16 -0
- package/dist/arrow/renderers/path/transforms/path-view-origins.d.ts.map +1 -0
- package/dist/arrow/renderers/path/transforms/path-view-origins.js +64 -0
- package/dist/arrow/renderers/path/transforms/path-view-origins.js.map +1 -0
- package/dist/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.cjs +182 -0
- package/dist/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.d.ts +36 -0
- package/dist/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.d.ts.map +1 -0
- package/dist/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.js +159 -0
- package/dist/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.js.map +1 -0
- package/dist/arrow/renderers/polygon/renderers/arrow-polygon-renderer.cjs +379 -0
- package/dist/arrow/renderers/polygon/renderers/arrow-polygon-renderer.d.ts +128 -0
- package/dist/arrow/renderers/polygon/renderers/arrow-polygon-renderer.d.ts.map +1 -0
- package/dist/arrow/renderers/polygon/renderers/arrow-polygon-renderer.js +354 -0
- package/dist/arrow/renderers/polygon/renderers/arrow-polygon-renderer.js.map +1 -0
- package/dist/arrow/renderers/polygon/source/arrow-polygon-source-mapping.cjs +74 -0
- package/dist/arrow/renderers/polygon/source/arrow-polygon-source-mapping.d.ts +25 -0
- package/dist/arrow/renderers/polygon/source/arrow-polygon-source-mapping.d.ts.map +1 -0
- package/dist/arrow/renderers/polygon/source/arrow-polygon-source-mapping.js +53 -0
- package/dist/arrow/renderers/polygon/source/arrow-polygon-source-mapping.js.map +1 -0
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-arrow.cjs +275 -0
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-arrow.d.ts +67 -0
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-arrow.d.ts.map +1 -0
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-arrow.js +304 -0
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-arrow.js.map +1 -0
- package/dist/arrow/renderers/text/conversion/arrow-text.cjs +579 -0
- package/dist/arrow/renderers/text/conversion/arrow-text.d.ts +124 -0
- package/dist/arrow/renderers/text/conversion/arrow-text.d.ts.map +1 -0
- package/dist/arrow/renderers/text/conversion/arrow-text.js +596 -0
- package/dist/arrow/renderers/text/conversion/arrow-text.js.map +1 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.cjs +119 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.d.ts +96 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.d.ts.map +1 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.js +129 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.js.map +1 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-dictionary.cjs +47 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-dictionary.d.ts +27 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-dictionary.d.ts.map +1 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-dictionary.js +39 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-dictionary.js.map +1 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-storage.cjs +63 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-storage.d.ts +28 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-storage.d.ts.map +1 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-storage.js +61 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-to-storage.js.map +1 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-vectors.cjs +2133 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-vectors.d.ts +295 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-vectors.d.ts.map +1 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-vectors.js +2228 -0
- package/dist/arrow/renderers/text/conversion/convert-arrow-text-vectors.js.map +1 -0
- package/dist/arrow/renderers/text/conversion/index.cjs +102 -0
- package/dist/arrow/renderers/text/conversion/index.d.ts +7 -0
- package/dist/arrow/renderers/text/conversion/index.d.ts.map +1 -0
- package/dist/arrow/renderers/text/conversion/index.js +10 -0
- package/dist/arrow/renderers/text/conversion/index.js.map +1 -0
- package/dist/arrow/renderers/text/conversion/make-gpu-text-data-from-arrow.cjs +205 -0
- package/dist/arrow/renderers/text/conversion/make-gpu-text-data-from-arrow.d.ts +37 -0
- package/dist/arrow/renderers/text/conversion/make-gpu-text-data-from-arrow.d.ts.map +1 -0
- package/dist/arrow/renderers/text/conversion/make-gpu-text-data-from-arrow.js +196 -0
- package/dist/arrow/renderers/text/conversion/make-gpu-text-data-from-arrow.js.map +1 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-picking.cjs +149 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-picking.d.ts +14 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-picking.d.ts.map +1 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-picking.js +117 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-picking.js.map +1 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.cjs +987 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.d.ts +196 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.d.ts.map +1 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.js +1042 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-renderer.js.map +1 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.cjs +996 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.d.ts +129 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.d.ts.map +1 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js +944 -0
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js.map +1 -0
- package/dist/arrow/renderers/text/source/arrow-text-source-mapping.cjs +92 -0
- package/dist/arrow/renderers/text/source/arrow-text-source-mapping.d.ts +55 -0
- package/dist/arrow/renderers/text/source/arrow-text-source-mapping.d.ts.map +1 -0
- package/dist/arrow/renderers/text/source/arrow-text-source-mapping.js +72 -0
- package/dist/arrow/renderers/text/source/arrow-text-source-mapping.js.map +1 -0
- package/dist/arrow/renderers/text/source/index.cjs +27 -0
- package/dist/arrow/renderers/text/source/index.d.ts +2 -0
- package/dist/arrow/renderers/text/source/index.d.ts.map +1 -0
- package/dist/arrow/renderers/text/source/index.js +5 -0
- package/dist/arrow/renderers/text/source/index.js.map +1 -0
- package/dist/compute/buffer-transform.cjs +2 -2
- package/dist/compute/buffer-transform.js +1 -1
- package/dist/compute/buffer-transform.js.map +1 -1
- package/dist/compute/computation.cjs +11 -6
- package/dist/compute/computation.d.ts +4 -4
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/computation.js +11 -4
- package/dist/compute/computation.js.map +1 -1
- package/dist/compute/texture-transform.cjs +2 -2
- package/dist/compute/texture-transform.js +1 -1
- package/dist/compute/texture-transform.js.map +1 -1
- package/dist/dist.dev.js +36330 -48
- package/dist/dist.min.js +143 -32
- package/dist/effects/index.cjs +211 -0
- package/dist/effects/index.cjs.map +6 -0
- package/dist/effects/index.d.ts +78 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/index.js +47 -0
- package/dist/effects/index.js.map +1 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.cjs +935 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts +16 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js +972 -0
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.cjs +87 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts +43 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js +67 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.cjs +106 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.d.ts +43 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js +86 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.cjs +112 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.d.ts +46 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js +95 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.cjs +81 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.d.ts +33 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js +59 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/persistence.cjs +69 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/persistence.d.ts +19 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/persistence.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/persistence.js +49 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/persistence.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.cjs +91 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.d.ts +30 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js +70 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.cjs +96 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts +44 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js +71 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/tone-mapping.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.cjs +80 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.d.ts +30 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js +55 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.cjs +80 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.d.ts +45 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js +58 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.cjs +1055 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts +1313 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js +1009 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.cjs +163 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts +15 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.js +142 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.cjs +578 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.d.ts +112 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.js +549 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom.cjs +131 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom.d.ts +49 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom.js +109 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/bloom.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/gaussianblur.cjs +199 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/gaussianblur.d.ts +49 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/gaussianblur.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/gaussianblur.js +177 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/gaussianblur.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/tiltshift.cjs +152 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/tiltshift.d.ts +81 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/tiltshift.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/tiltshift.js +162 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/tiltshift.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/triangleblur.cjs +132 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/triangleblur.d.ts +58 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/triangleblur.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/triangleblur.js +112 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/triangleblur.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/zoomblur.cjs +114 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/zoomblur.d.ts +44 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/zoomblur.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/zoomblur.js +90 -0
- package/dist/effects/passes/postprocessing/image-blur-filters/zoomblur.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/colorhalftone.cjs +124 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/colorhalftone.d.ts +53 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/colorhalftone.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/colorhalftone.js +105 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/colorhalftone.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/dotscreen.cjs +98 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/dotscreen.d.ts +51 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/dotscreen.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/dotscreen.js +77 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/dotscreen.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/edgework.cjs +227 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/edgework.d.ts +56 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/edgework.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/edgework.js +206 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/edgework.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/hexagonalpixelate.cjs +148 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts +44 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/hexagonalpixelate.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/hexagonalpixelate.js +127 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/hexagonalpixelate.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/ink.cjs +113 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/ink.d.ts +41 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/ink.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/ink.js +93 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/ink.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/magnify.cjs +107 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/magnify.d.ts +46 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/magnify.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/magnify.js +84 -0
- package/dist/effects/passes/postprocessing/image-fun-filters/magnify.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/bulgepinch.cjs +123 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/bulgepinch.d.ts +51 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/bulgepinch.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/bulgepinch.js +101 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/bulgepinch.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/swirl.cjs +118 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/swirl.d.ts +52 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/swirl.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/swirl.js +95 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/swirl.js.map +1 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/warp.cjs +63 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/warp.d.ts +9 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/warp.d.ts.map +1 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/warp.js +37 -0
- package/dist/effects/passes/postprocessing/image-warp-filters/warp.js.map +1 -0
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.cjs +214 -0
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts +109 -0
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js +197 -0
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.js.map +1 -0
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.cjs +716 -0
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +366 -0
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js +683 -0
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.js.map +1 -0
- package/dist/effects/passes/screen-space/copy-pass.cjs +36 -0
- package/dist/effects/passes/screen-space/copy-pass.d.ts +8 -0
- package/dist/effects/passes/screen-space/copy-pass.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/copy-pass.js +12 -0
- package/dist/effects/passes/screen-space/copy-pass.js.map +1 -0
- package/dist/effects/passes/screen-space/depth-aware-blur.cjs +109 -0
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts +156 -0
- package/dist/effects/passes/screen-space/depth-aware-blur.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/depth-aware-blur.js +83 -0
- package/dist/effects/passes/screen-space/depth-aware-blur.js.map +1 -0
- package/dist/effects/passes/screen-space/dof.cjs +250 -0
- package/dist/effects/passes/screen-space/dof.d.ts +271 -0
- package/dist/effects/passes/screen-space/dof.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/dof.js +239 -0
- package/dist/effects/passes/screen-space/dof.js.map +1 -0
- package/dist/effects/passes/screen-space/gtao.cjs +543 -0
- package/dist/effects/passes/screen-space/gtao.d.ts +222 -0
- package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/gtao.js +507 -0
- package/dist/effects/passes/screen-space/gtao.js.map +1 -0
- package/dist/effects/passes/screen-space/hdr-auto-exposure.cjs +318 -0
- package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts +149 -0
- package/dist/effects/passes/screen-space/hdr-auto-exposure.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/hdr-auto-exposure.js +285 -0
- package/dist/effects/passes/screen-space/hdr-auto-exposure.js.map +1 -0
- package/dist/effects/passes/screen-space/height-fog.cjs +144 -0
- package/dist/effects/passes/screen-space/height-fog.d.ts +80 -0
- package/dist/effects/passes/screen-space/height-fog.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/height-fog.js +117 -0
- package/dist/effects/passes/screen-space/height-fog.js.map +1 -0
- package/dist/effects/passes/screen-space/motion-blur.cjs +80 -0
- package/dist/effects/passes/screen-space/motion-blur.d.ts +45 -0
- package/dist/effects/passes/screen-space/motion-blur.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/motion-blur.js +54 -0
- package/dist/effects/passes/screen-space/motion-blur.js.map +1 -0
- package/dist/effects/passes/screen-space/outlines.cjs +106 -0
- package/dist/effects/passes/screen-space/outlines.d.ts +62 -0
- package/dist/effects/passes/screen-space/outlines.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/outlines.js +80 -0
- package/dist/effects/passes/screen-space/outlines.js.map +1 -0
- package/dist/effects/passes/screen-space/screen-space-global-illumination.cjs +549 -0
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +243 -0
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/screen-space-global-illumination.js +513 -0
- package/dist/effects/passes/screen-space/screen-space-global-illumination.js.map +1 -0
- package/dist/effects/passes/screen-space/screen-space-reflections.cjs +678 -0
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +304 -0
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/screen-space-reflections.js +646 -0
- package/dist/effects/passes/screen-space/screen-space-reflections.js.map +1 -0
- package/dist/effects/passes/screen-space/screen-space-shader-helpers.cjs +111 -0
- package/dist/effects/passes/screen-space/screen-space-shader-helpers.d.ts +5 -0
- package/dist/effects/passes/screen-space/screen-space-shader-helpers.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/screen-space-shader-helpers.js +84 -0
- package/dist/effects/passes/screen-space/screen-space-shader-helpers.js.map +1 -0
- package/dist/effects/passes/screen-space/selection-outline.cjs +86 -0
- package/dist/effects/passes/screen-space/selection-outline.d.ts +30 -0
- package/dist/effects/passes/screen-space/selection-outline.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/selection-outline.js +59 -0
- package/dist/effects/passes/screen-space/selection-outline.js.map +1 -0
- package/dist/effects/passes/screen-space/ssao.cjs +172 -0
- package/dist/effects/passes/screen-space/ssao.d.ts +98 -0
- package/dist/effects/passes/screen-space/ssao.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/ssao.js +142 -0
- package/dist/effects/passes/screen-space/ssao.js.map +1 -0
- package/dist/effects/passes/screen-space/ssr-camera-temporal.cjs +173 -0
- package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts +112 -0
- package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/ssr-camera-temporal.js +141 -0
- package/dist/effects/passes/screen-space/ssr-camera-temporal.js.map +1 -0
- package/dist/effects/passes/screen-space/temporal-antialiasing.cjs +137 -0
- package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts +68 -0
- package/dist/effects/passes/screen-space/temporal-antialiasing.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/temporal-antialiasing.js +107 -0
- package/dist/effects/passes/screen-space/temporal-antialiasing.js.map +1 -0
- package/dist/effects/passes/screen-space/volumetric-fog.cjs +109 -0
- package/dist/effects/passes/screen-space/volumetric-fog.d.ts +68 -0
- package/dist/effects/passes/screen-space/volumetric-fog.d.ts.map +1 -0
- package/dist/effects/passes/screen-space/volumetric-fog.js +83 -0
- package/dist/effects/passes/screen-space/volumetric-fog.js.map +1 -0
- package/dist/experimental/materials/emissive-material.d.ts +1 -1
- package/dist/experimental/materials/emissive-material.d.ts.map +1 -1
- package/dist/experimental/materials/glass-material.d.ts +1 -1
- package/dist/experimental/materials/glass-material.d.ts.map +1 -1
- package/dist/experimental/materials/glass-transmission.d.ts +1 -1
- package/dist/experimental/materials/glass-transmission.d.ts.map +1 -1
- package/dist/experimental/materials/optical-caustics.d.ts +1 -1
- package/dist/experimental/materials/optical-caustics.d.ts.map +1 -1
- package/dist/experimental/materials/optical-point-lights.d.ts +1 -1
- package/dist/experimental/materials/optical-point-lights.d.ts.map +1 -1
- package/dist/experimental/materials/reflective-material.d.ts +1 -1
- package/dist/experimental/materials/reflective-material.d.ts.map +1 -1
- package/dist/gltf/gltf/animations/animations.cjs +15 -0
- package/dist/gltf/gltf/animations/animations.d.ts +97 -0
- package/dist/gltf/gltf/animations/animations.d.ts.map +1 -0
- package/dist/gltf/gltf/animations/animations.js +5 -0
- package/dist/gltf/gltf/animations/animations.js.map +1 -0
- package/dist/gltf/gltf/create-gltf-model.cjs +792 -0
- package/dist/gltf/gltf/create-gltf-model.d.ts +65 -0
- package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -0
- package/dist/gltf/gltf/create-gltf-model.js +785 -0
- package/dist/gltf/gltf/create-gltf-model.js.map +1 -0
- package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +207 -0
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts +66 -0
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -0
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js +186 -0
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -0
- package/dist/gltf/gltf/gltf-animated-crowd.cjs +966 -0
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts +253 -0
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-animated-crowd.js +1002 -0
- package/dist/gltf/gltf/gltf-animated-crowd.js.map +1 -0
- package/dist/gltf/gltf/gltf-animator.cjs +159 -0
- package/dist/gltf/gltf/gltf-animator.d.ts +69 -0
- package/dist/gltf/gltf/gltf-animator.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-animator.js +141 -0
- package/dist/gltf/gltf/gltf-animator.js.map +1 -0
- package/dist/gltf/gltf/gltf-area-lights.cjs +57 -0
- package/dist/gltf/gltf/gltf-area-lights.d.ts +10 -0
- package/dist/gltf/gltf/gltf-area-lights.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-area-lights.js +35 -0
- package/dist/gltf/gltf/gltf-area-lights.js.map +1 -0
- package/dist/gltf/gltf/gltf-audio.cjs +90 -0
- package/dist/gltf/gltf/gltf-audio.d.ts +87 -0
- package/dist/gltf/gltf/gltf-audio.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-audio.js +68 -0
- package/dist/gltf/gltf/gltf-audio.js.map +1 -0
- package/dist/gltf/gltf/gltf-billboard.cjs +46 -0
- package/dist/gltf/gltf/gltf-billboard.d.ts +14 -0
- package/dist/gltf/gltf/gltf-billboard.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-billboard.js +29 -0
- package/dist/gltf/gltf/gltf-billboard.js.map +1 -0
- package/dist/gltf/gltf/gltf-extension-support.cjs +380 -0
- package/dist/gltf/gltf/gltf-extension-support.d.ts +33 -0
- package/dist/gltf/gltf/gltf-extension-support.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-extension-support.js +360 -0
- package/dist/gltf/gltf/gltf-extension-support.js.map +1 -0
- package/dist/gltf/gltf/gltf-gpu-animation.cjs +66 -0
- package/dist/gltf/gltf/gltf-gpu-animation.d.ts +28 -0
- package/dist/gltf/gltf/gltf-gpu-animation.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-gpu-animation.js +42 -0
- package/dist/gltf/gltf/gltf-gpu-animation.js.map +1 -0
- package/dist/gltf/gltf/gltf-instancing.cjs +106 -0
- package/dist/gltf/gltf/gltf-instancing.d.ts +23 -0
- package/dist/gltf/gltf/gltf-instancing.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-instancing.js +89 -0
- package/dist/gltf/gltf/gltf-instancing.js.map +1 -0
- package/dist/gltf/gltf/gltf-lightmap.cjs +100 -0
- package/dist/gltf/gltf/gltf-lightmap.d.ts +44 -0
- package/dist/gltf/gltf/gltf-lightmap.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-lightmap.js +79 -0
- package/dist/gltf/gltf/gltf-lightmap.js.map +1 -0
- package/dist/gltf/gltf/gltf-lod.cjs +256 -0
- package/dist/gltf/gltf/gltf-lod.d.ts +36 -0
- package/dist/gltf/gltf/gltf-lod.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-lod.js +253 -0
- package/dist/gltf/gltf/gltf-lod.js.map +1 -0
- package/dist/gltf/gltf/gltf-material-variants.cjs +49 -0
- package/dist/gltf/gltf/gltf-material-variants.d.ts +5 -0
- package/dist/gltf/gltf/gltf-material-variants.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-material-variants.js +27 -0
- package/dist/gltf/gltf/gltf-material-variants.js.map +1 -0
- package/dist/gltf/gltf/gltf-materials-scatter.cjs +53 -0
- package/dist/gltf/gltf/gltf-materials-scatter.d.ts +15 -0
- package/dist/gltf/gltf/gltf-materials-scatter.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-materials-scatter.js +34 -0
- package/dist/gltf/gltf/gltf-materials-scatter.js.map +1 -0
- package/dist/gltf/gltf/gltf-skin.cjs +115 -0
- package/dist/gltf/gltf/gltf-skin.d.ts +19 -0
- package/dist/gltf/gltf/gltf-skin.d.ts.map +1 -0
- package/dist/gltf/gltf/gltf-skin.js +92 -0
- package/dist/gltf/gltf/gltf-skin.js.map +1 -0
- package/dist/gltf/gltf/morph-targets.cjs +27 -0
- package/dist/gltf/gltf/morph-targets.d.ts +3 -0
- package/dist/gltf/gltf/morph-targets.d.ts.map +1 -0
- package/dist/gltf/gltf/morph-targets.js +5 -0
- package/dist/gltf/gltf/morph-targets.js.map +1 -0
- package/dist/gltf/index.cjs +112 -0
- package/dist/gltf/index.cjs.map +6 -0
- package/dist/gltf/index.d.ts +28 -0
- package/dist/gltf/index.d.ts.map +1 -0
- package/dist/gltf/index.js +27 -0
- package/dist/gltf/index.js.map +1 -0
- package/dist/gltf/parsers/gltf-accessor-utils.cjs +79 -0
- package/dist/gltf/parsers/gltf-accessor-utils.d.ts +13 -0
- package/dist/gltf/parsers/gltf-accessor-utils.d.ts.map +1 -0
- package/dist/gltf/parsers/gltf-accessor-utils.js +60 -0
- package/dist/gltf/parsers/gltf-accessor-utils.js.map +1 -0
- package/dist/gltf/parsers/parse-gltf-animations.cjs +479 -0
- package/dist/gltf/parsers/parse-gltf-animations.d.ts +5 -0
- package/dist/gltf/parsers/parse-gltf-animations.d.ts.map +1 -0
- package/dist/gltf/parsers/parse-gltf-animations.js +558 -0
- package/dist/gltf/parsers/parse-gltf-animations.js.map +1 -0
- package/dist/gltf/parsers/parse-gltf-joints.cjs +146 -0
- package/dist/gltf/parsers/parse-gltf-joints.d.ts +20 -0
- package/dist/gltf/parsers/parse-gltf-joints.d.ts.map +1 -0
- package/dist/gltf/parsers/parse-gltf-joints.js +129 -0
- package/dist/gltf/parsers/parse-gltf-joints.js.map +1 -0
- package/dist/gltf/parsers/parse-gltf-lights.cjs +171 -0
- package/dist/gltf/parsers/parse-gltf-lights.d.ts +17 -0
- package/dist/gltf/parsers/parse-gltf-lights.d.ts.map +1 -0
- package/dist/gltf/parsers/parse-gltf-lights.js +187 -0
- package/dist/gltf/parsers/parse-gltf-lights.js.map +1 -0
- package/dist/gltf/parsers/parse-gltf-physics-pointer.cjs +35 -0
- package/dist/gltf/parsers/parse-gltf-physics-pointer.d.ts +3 -0
- package/dist/gltf/parsers/parse-gltf-physics-pointer.d.ts.map +1 -0
- package/dist/gltf/parsers/parse-gltf-physics-pointer.js +21 -0
- package/dist/gltf/parsers/parse-gltf-physics-pointer.js.map +1 -0
- package/dist/gltf/parsers/parse-gltf.cjs +405 -0
- package/dist/gltf/parsers/parse-gltf.d.ts +45 -0
- package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -0
- package/dist/gltf/parsers/parse-gltf.js +405 -0
- package/dist/gltf/parsers/parse-gltf.js.map +1 -0
- package/dist/gltf/parsers/parse-pbr-material.cjs +821 -0
- package/dist/gltf/parsers/parse-pbr-material.d.ts +179 -0
- package/dist/gltf/parsers/parse-pbr-material.d.ts.map +1 -0
- package/dist/gltf/parsers/parse-pbr-material.js +1045 -0
- package/dist/gltf/parsers/parse-pbr-material.js.map +1 -0
- package/dist/gltf/parsers/post-process-gltf.cjs +560 -0
- package/dist/gltf/parsers/post-process-gltf.d.ts +8 -0
- package/dist/gltf/parsers/post-process-gltf.d.ts.map +1 -0
- package/dist/gltf/parsers/post-process-gltf.js +581 -0
- package/dist/gltf/parsers/post-process-gltf.js.map +1 -0
- package/dist/gltf/pbr/pbr-environment.cjs +96 -0
- package/dist/gltf/pbr/pbr-environment.d.ts +25 -0
- package/dist/gltf/pbr/pbr-environment.d.ts.map +1 -0
- package/dist/gltf/pbr/pbr-environment.js +75 -0
- package/dist/gltf/pbr/pbr-environment.js.map +1 -0
- package/dist/gltf/pbr/pbr-material.cjs +15 -0
- package/dist/gltf/pbr/pbr-material.d.ts +23 -0
- package/dist/gltf/pbr/pbr-material.d.ts.map +1 -0
- package/dist/gltf/pbr/pbr-material.js +5 -0
- package/dist/gltf/pbr/pbr-material.js.map +1 -0
- package/dist/gltf/pbr/texture-transform.cjs +130 -0
- package/dist/gltf/pbr/texture-transform.d.ts +21 -0
- package/dist/gltf/pbr/texture-transform.d.ts.map +1 -0
- package/dist/gltf/pbr/texture-transform.js +109 -0
- package/dist/gltf/pbr/texture-transform.js.map +1 -0
- package/dist/gltf/physics/export-state.cjs +194 -0
- package/dist/gltf/physics/export-state.d.ts +9 -0
- package/dist/gltf/physics/export-state.d.ts.map +1 -0
- package/dist/gltf/physics/export-state.js +203 -0
- package/dist/gltf/physics/export-state.js.map +1 -0
- package/dist/gltf/physics/index.cjs +103 -0
- package/dist/gltf/physics/index.cjs.map +6 -0
- package/dist/gltf/physics/index.d.ts +17 -0
- package/dist/gltf/physics/index.d.ts.map +1 -0
- package/dist/gltf/physics/index.js +68 -0
- package/dist/gltf/physics/index.js.map +1 -0
- package/dist/gltf/physics/mesh-box-shape.cjs +66 -0
- package/dist/gltf/physics/mesh-box-shape.d.ts +6 -0
- package/dist/gltf/physics/mesh-box-shape.d.ts.map +1 -0
- package/dist/gltf/physics/mesh-box-shape.js +46 -0
- package/dist/gltf/physics/mesh-box-shape.js.map +1 -0
- package/dist/gltf/physics/mesh-snapshot.cjs +192 -0
- package/dist/gltf/physics/mesh-snapshot.d.ts +19 -0
- package/dist/gltf/physics/mesh-snapshot.d.ts.map +1 -0
- package/dist/gltf/physics/mesh-snapshot.js +190 -0
- package/dist/gltf/physics/mesh-snapshot.js.map +1 -0
- package/dist/gltf/physics/node-collision-geometry.cjs +101 -0
- package/dist/gltf/physics/node-collision-geometry.d.ts +9 -0
- package/dist/gltf/physics/node-collision-geometry.d.ts.map +1 -0
- package/dist/gltf/physics/node-collision-geometry.js +85 -0
- package/dist/gltf/physics/node-collision-geometry.js.map +1 -0
- package/dist/gltf/physics/parse-gltf-physics.cjs +700 -0
- package/dist/gltf/physics/parse-gltf-physics.d.ts +8 -0
- package/dist/gltf/physics/parse-gltf-physics.d.ts.map +1 -0
- package/dist/gltf/physics/parse-gltf-physics.js +780 -0
- package/dist/gltf/physics/parse-gltf-physics.js.map +1 -0
- package/dist/gltf/physics/parse-physics-joints.cjs +71 -0
- package/dist/gltf/physics/parse-physics-joints.d.ts +5 -0
- package/dist/gltf/physics/parse-physics-joints.d.ts.map +1 -0
- package/dist/gltf/physics/parse-physics-joints.js +56 -0
- package/dist/gltf/physics/parse-physics-joints.js.map +1 -0
- package/dist/gltf/physics/physics-transforms.cjs +33 -0
- package/dist/gltf/physics/physics-transforms.d.ts +3 -0
- package/dist/gltf/physics/physics-transforms.d.ts.map +1 -0
- package/dist/gltf/physics/physics-transforms.js +5 -0
- package/dist/gltf/physics/physics-transforms.js.map +1 -0
- package/dist/gltf/physics/physics-types.cjs +15 -0
- package/dist/gltf/physics/physics-types.d.ts +126 -0
- package/dist/gltf/physics/physics-types.d.ts.map +1 -0
- package/dist/gltf/physics/physics-types.js +5 -0
- package/dist/gltf/physics/physics-types.js.map +1 -0
- package/dist/gltf/physics/property-bindings.cjs +137 -0
- package/dist/gltf/physics/property-bindings.d.ts +6 -0
- package/dist/gltf/physics/property-bindings.d.ts.map +1 -0
- package/dist/gltf/physics/property-bindings.js +149 -0
- package/dist/gltf/physics/property-bindings.js.map +1 -0
- package/dist/gltf/physics/scene-bindings.cjs +59 -0
- package/dist/gltf/physics/scene-bindings.d.ts +10 -0
- package/dist/gltf/physics/scene-bindings.d.ts.map +1 -0
- package/dist/gltf/physics/scene-bindings.js +38 -0
- package/dist/gltf/physics/scene-bindings.js.map +1 -0
- package/dist/gltf/physics/snapshot-scene.cjs +43 -0
- package/dist/gltf/physics/snapshot-scene.d.ts +8 -0
- package/dist/gltf/physics/snapshot-scene.d.ts.map +1 -0
- package/dist/gltf/physics/snapshot-scene.js +22 -0
- package/dist/gltf/physics/snapshot-scene.js.map +1 -0
- package/dist/gltf/types/gltf-json-schema.cjs +15 -0
- package/dist/gltf/types/gltf-json-schema.d.ts +830 -0
- package/dist/gltf/types/gltf-json-schema.d.ts.map +1 -0
- package/dist/gltf/types/gltf-json-schema.js +4 -0
- package/dist/gltf/types/gltf-json-schema.js.map +1 -0
- package/dist/gltf/types/gltf-postprocessed-schema.cjs +15 -0
- package/dist/gltf/types/gltf-postprocessed-schema.d.ts +657 -0
- package/dist/gltf/types/gltf-postprocessed-schema.d.ts.map +1 -0
- package/dist/gltf/types/gltf-postprocessed-schema.js +4 -0
- package/dist/gltf/types/gltf-postprocessed-schema.js.map +1 -0
- package/dist/gltf/types/gltf-shape-schema.cjs +15 -0
- package/dist/gltf/types/gltf-shape-schema.d.ts +49 -0
- package/dist/gltf/types/gltf-shape-schema.d.ts.map +1 -0
- package/dist/gltf/types/gltf-shape-schema.js +6 -0
- package/dist/gltf/types/gltf-shape-schema.js.map +1 -0
- package/dist/gltf/types/gltf-types.cjs +15 -0
- package/dist/gltf/types/gltf-types.d.ts +79 -0
- package/dist/gltf/types/gltf-types.d.ts.map +1 -0
- package/dist/gltf/types/gltf-types.js +5 -0
- package/dist/gltf/types/gltf-types.js.map +1 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-sampler.cjs +131 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-sampler.d.ts +20 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-sampler.d.ts.map +1 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-sampler.js +111 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-sampler.js.map +1 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-topology.cjs +68 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-topology.d.ts +19 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-topology.d.ts.map +1 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-topology.js +54 -0
- package/dist/gltf/webgl-to-webgpu/convert-webgl-topology.js.map +1 -0
- package/dist/gltf/webgl-to-webgpu/gltf-webgl-constants.cjs +54 -0
- package/dist/gltf/webgl-to-webgpu/gltf-webgl-constants.d.ts +28 -0
- package/dist/gltf/webgl-to-webgpu/gltf-webgl-constants.d.ts.map +1 -0
- package/dist/gltf/webgl-to-webgpu/gltf-webgl-constants.js +35 -0
- package/dist/gltf/webgl-to-webgpu/gltf-webgl-constants.js.map +1 -0
- package/dist/graph/models/index.cjs.map +2 -2
- package/dist/graph/models/polygon/polygon-shaders.d.ts +2 -2
- package/dist/graph/models/polygon/polygon-shaders.d.ts.map +1 -1
- package/dist/graph/tables/index.cjs.map +2 -2
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lighting/ltc-data.cjs +32800 -0
- package/dist/lighting/ltc-data.d.ts +3 -0
- package/dist/lighting/ltc-data.d.ts.map +1 -0
- package/dist/lighting/ltc-data.js +3278 -0
- package/dist/lighting/ltc-data.js.map +1 -0
- package/dist/lighting/ltc-textures.cjs +48 -0
- package/dist/lighting/ltc-textures.d.ts +10 -0
- package/dist/lighting/ltc-textures.d.ts.map +1 -0
- package/dist/lighting/ltc-textures.js +27 -0
- package/dist/lighting/ltc-textures.js.map +1 -0
- package/dist/material/material-factory.d.ts +1 -1
- package/dist/material/material-factory.d.ts.map +1 -1
- package/dist/material/material.d.ts +1 -1
- package/dist/material/material.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.cjs +7 -5
- package/dist/model/gpu-vector-model.d.ts +5 -5
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.js +10 -5
- package/dist/model/gpu-vector-model.js.map +1 -1
- package/dist/model/split-uniforms-and-bindings.d.ts +1 -1
- package/dist/model/split-uniforms-and-bindings.d.ts.map +1 -1
- package/dist/models/light-model-utils.d.ts +1 -1
- package/dist/models/light-model-utils.d.ts.map +1 -1
- package/dist/models/light-model-utils.js.map +1 -1
- package/dist/modules/picking/color-picking.d.ts +1 -1
- package/dist/modules/picking/index-color-picking.d.ts +1 -1
- package/dist/modules/picking/index-picking.d.ts +1 -1
- package/dist/modules/picking/legacy-color-picking.cjs +2 -2
- package/dist/modules/picking/legacy-color-picking.d.ts +3 -3
- package/dist/modules/picking/legacy-color-picking.d.ts.map +1 -1
- package/dist/modules/picking/legacy-color-picking.js +2 -2
- package/dist/modules/picking/legacy-color-picking.js.map +1 -1
- package/dist/modules/picking/legacy-picking-manager.d.ts +1 -1
- package/dist/modules/picking/legacy-picking-manager.d.ts.map +1 -1
- package/dist/modules/picking/picking-uniforms.d.ts +1 -1
- package/dist/modules/picking/picking.d.ts +1 -1
- package/dist/passes/get-fragment-shader.d.ts +1 -1
- package/dist/passes/get-fragment-shader.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.cjs +2 -2
- package/dist/passes/shader-pass-renderer.d.ts +1 -1
- package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.js +1 -1
- package/dist/passes/shader-pass-renderer.js.map +1 -1
- package/dist/scenegraph/controllers/area-light-controller.d.ts +1 -1
- package/dist/scenegraph/controllers/area-light-controller.d.ts.map +1 -1
- package/dist/shader-inputs.cjs +3 -3
- package/dist/shader-inputs.d.ts +1 -1
- package/dist/shader-inputs.d.ts.map +1 -1
- package/dist/shader-inputs.js +1 -1
- package/dist/shader-inputs.js.map +1 -1
- package/dist/splats/gpu-paged-splat-renderer.cjs +1155 -0
- package/dist/splats/gpu-paged-splat-renderer.d.ts +184 -0
- package/dist/splats/gpu-paged-splat-renderer.d.ts.map +1 -0
- package/dist/splats/gpu-paged-splat-renderer.js +1186 -0
- package/dist/splats/gpu-paged-splat-renderer.js.map +1 -0
- package/dist/splats/gpu-paged-splat-shaders.cjs +283 -0
- package/dist/splats/gpu-paged-splat-shaders.d.ts +64 -0
- package/dist/splats/gpu-paged-splat-shaders.d.ts.map +1 -0
- package/dist/splats/gpu-paged-splat-shaders.js +263 -0
- package/dist/splats/gpu-paged-splat-shaders.js.map +1 -0
- package/dist/splats/gpu-splat-graph-interaction.cjs +503 -0
- package/dist/splats/gpu-splat-graph-interaction.d.ts +111 -0
- package/dist/splats/gpu-splat-graph-interaction.d.ts.map +1 -0
- package/dist/splats/gpu-splat-graph-interaction.js +507 -0
- package/dist/splats/gpu-splat-graph-interaction.js.map +1 -0
- package/dist/splats/gpu-splat-graph-renderer.cjs +827 -0
- package/dist/splats/gpu-splat-graph-renderer.d.ts +144 -0
- package/dist/splats/gpu-splat-graph-renderer.d.ts.map +1 -0
- package/dist/splats/gpu-splat-graph-renderer.js +847 -0
- package/dist/splats/gpu-splat-graph-renderer.js.map +1 -0
- package/dist/splats/gpu-splat-graph-shaders.cjs +546 -0
- package/dist/splats/gpu-splat-graph-shaders.d.ts +70 -0
- package/dist/splats/gpu-splat-graph-shaders.d.ts.map +1 -0
- package/dist/splats/gpu-splat-graph-shaders.js +508 -0
- package/dist/splats/gpu-splat-graph-shaders.js.map +1 -0
- package/dist/splats/index.cjs +135 -0
- package/dist/splats/index.cjs.map +6 -0
- package/dist/splats/index.d.ts +16 -0
- package/dist/splats/index.d.ts.map +1 -0
- package/dist/splats/index.js +19 -0
- package/dist/splats/index.js.map +1 -0
- package/dist/splats/splat-covariance.cjs +150 -0
- package/dist/splats/splat-covariance.d.ts +34 -0
- package/dist/splats/splat-covariance.d.ts.map +1 -0
- package/dist/splats/splat-covariance.js +129 -0
- package/dist/splats/splat-covariance.js.map +1 -0
- package/dist/splats/splat-data.cjs +264 -0
- package/dist/splats/splat-data.d.ts +131 -0
- package/dist/splats/splat-data.d.ts.map +1 -0
- package/dist/splats/splat-data.js +254 -0
- package/dist/splats/splat-data.js.map +1 -0
- package/dist/splats/splat-filter.cjs +49 -0
- package/dist/splats/splat-filter.d.ts +17 -0
- package/dist/splats/splat-filter.d.ts.map +1 -0
- package/dist/splats/splat-filter.js +30 -0
- package/dist/splats/splat-filter.js.map +1 -0
- package/dist/splats/splat-gltf.cjs +216 -0
- package/dist/splats/splat-gltf.d.ts +83 -0
- package/dist/splats/splat-gltf.d.ts.map +1 -0
- package/dist/splats/splat-gltf.js +229 -0
- package/dist/splats/splat-gltf.js.map +1 -0
- package/dist/splats/splat-hierarchy.cjs +410 -0
- package/dist/splats/splat-hierarchy.d.ts +192 -0
- package/dist/splats/splat-hierarchy.d.ts.map +1 -0
- package/dist/splats/splat-hierarchy.js +412 -0
- package/dist/splats/splat-hierarchy.js.map +1 -0
- package/dist/splats/splat-picking.cjs +448 -0
- package/dist/splats/splat-picking.d.ts +93 -0
- package/dist/splats/splat-picking.d.ts.map +1 -0
- package/dist/splats/splat-picking.js +442 -0
- package/dist/splats/splat-picking.js.map +1 -0
- package/dist/splats/splat-rad-hierarchy.cjs +2033 -0
- package/dist/splats/splat-rad-hierarchy.d.ts +356 -0
- package/dist/splats/splat-rad-hierarchy.d.ts.map +1 -0
- package/dist/splats/splat-rad-hierarchy.js +2187 -0
- package/dist/splats/splat-rad-hierarchy.js.map +1 -0
- package/dist/splats/splat-renderer.cjs +979 -0
- package/dist/splats/splat-renderer.d.ts +226 -0
- package/dist/splats/splat-renderer.d.ts.map +1 -0
- package/dist/splats/splat-renderer.js +1003 -0
- package/dist/splats/splat-renderer.js.map +1 -0
- package/dist/splats/splat-residency.cjs +443 -0
- package/dist/splats/splat-residency.d.ts +199 -0
- package/dist/splats/splat-residency.d.ts.map +1 -0
- package/dist/splats/splat-residency.js +442 -0
- package/dist/splats/splat-residency.js.map +1 -0
- package/dist/splats/splat-shaders.cjs +468 -0
- package/dist/splats/splat-shaders.d.ts +103 -0
- package/dist/splats/splat-shaders.d.ts.map +1 -0
- package/dist/splats/splat-shaders.js +431 -0
- package/dist/splats/splat-shaders.js.map +1 -0
- package/dist/splats/splat-sort.cjs +146 -0
- package/dist/splats/splat-sort.d.ts +30 -0
- package/dist/splats/splat-sort.d.ts.map +1 -0
- package/dist/splats/splat-sort.js +129 -0
- package/dist/splats/splat-sort.js.map +1 -0
- package/dist/splats/splat-spherical-harmonics.cjs +79 -0
- package/dist/splats/splat-spherical-harmonics.d.ts +14 -0
- package/dist/splats/splat-spherical-harmonics.d.ts.map +1 -0
- package/dist/splats/splat-spherical-harmonics.js +62 -0
- package/dist/splats/splat-spherical-harmonics.js.map +1 -0
- package/dist/text/experimental.cjs +21 -0
- package/dist/text/experimental.cjs.map +6 -0
- package/dist/text/experimental.d.ts +2 -0
- package/dist/text/experimental.d.ts.map +1 -0
- package/dist/text/experimental.js +5 -0
- package/dist/text/experimental.js.map +1 -0
- package/dist/text/fonts/atlas/browser-font-atlas.cjs +215 -0
- package/dist/text/fonts/atlas/browser-font-atlas.d.ts +55 -0
- package/dist/text/fonts/atlas/browser-font-atlas.d.ts.map +1 -0
- package/dist/text/fonts/atlas/browser-font-atlas.js +194 -0
- package/dist/text/fonts/atlas/browser-font-atlas.js.map +1 -0
- package/dist/text/fonts/atlas/font-atlas.cjs +15 -0
- package/dist/text/fonts/atlas/font-atlas.d.ts +48 -0
- package/dist/text/fonts/atlas/font-atlas.d.ts.map +1 -0
- package/dist/text/fonts/atlas/font-atlas.js +5 -0
- package/dist/text/fonts/atlas/font-atlas.js.map +1 -0
- package/dist/text/fonts/atlas/lru-cache.cjs +55 -0
- package/dist/text/fonts/atlas/lru-cache.d.ts +9 -0
- package/dist/text/fonts/atlas/lru-cache.d.ts.map +1 -0
- package/dist/text/fonts/atlas/lru-cache.js +34 -0
- package/dist/text/fonts/atlas/lru-cache.js.map +1 -0
- package/dist/text/fonts/atlas/text-glyph-walker.cjs +90 -0
- package/dist/text/fonts/atlas/text-glyph-walker.d.ts +39 -0
- package/dist/text/fonts/atlas/text-glyph-walker.d.ts.map +1 -0
- package/dist/text/fonts/atlas/text-glyph-walker.js +76 -0
- package/dist/text/fonts/atlas/text-glyph-walker.js.map +1 -0
- package/dist/text/fonts/atlas/text-metrics.cjs +35 -0
- package/dist/text/fonts/atlas/text-metrics.d.ts +25 -0
- package/dist/text/fonts/atlas/text-metrics.d.ts.map +1 -0
- package/dist/text/fonts/atlas/text-metrics.js +14 -0
- package/dist/text/fonts/atlas/text-metrics.js.map +1 -0
- package/dist/text/fonts/atlas/text-utils.cjs +96 -0
- package/dist/text/fonts/atlas/text-utils.d.ts +60 -0
- package/dist/text/fonts/atlas/text-utils.d.ts.map +1 -0
- package/dist/text/fonts/atlas/text-utils.js +72 -0
- package/dist/text/fonts/atlas/text-utils.js.map +1 -0
- package/dist/text/fonts/build-bitmap-font-atlas.cjs +36 -0
- package/dist/text/fonts/build-bitmap-font-atlas.d.ts +12 -0
- package/dist/text/fonts/build-bitmap-font-atlas.d.ts.map +1 -0
- package/dist/text/fonts/build-bitmap-font-atlas.js +20 -0
- package/dist/text/fonts/build-bitmap-font-atlas.js.map +1 -0
- package/dist/text/fonts/build-glyph-font-atlas.cjs +79 -0
- package/dist/text/fonts/build-glyph-font-atlas.d.ts +14 -0
- package/dist/text/fonts/build-glyph-font-atlas.d.ts.map +1 -0
- package/dist/text/fonts/build-glyph-font-atlas.js +67 -0
- package/dist/text/fonts/build-glyph-font-atlas.js.map +1 -0
- package/dist/text/fonts/build-msdf-font-atlas.cjs +148 -0
- package/dist/text/fonts/build-msdf-font-atlas.d.ts +92 -0
- package/dist/text/fonts/build-msdf-font-atlas.d.ts.map +1 -0
- package/dist/text/fonts/build-msdf-font-atlas.js +137 -0
- package/dist/text/fonts/build-msdf-font-atlas.js.map +1 -0
- package/dist/text/fonts/build-sdf-font-atlas.cjs +89 -0
- package/dist/text/fonts/build-sdf-font-atlas.d.ts +19 -0
- package/dist/text/fonts/build-sdf-font-atlas.d.ts.map +1 -0
- package/dist/text/fonts/build-sdf-font-atlas.js +65 -0
- package/dist/text/fonts/build-sdf-font-atlas.js.map +1 -0
- package/dist/text/fonts/glyph-pbf.cjs +155 -0
- package/dist/text/fonts/glyph-pbf.d.ts +38 -0
- package/dist/text/fonts/glyph-pbf.d.ts.map +1 -0
- package/dist/text/fonts/glyph-pbf.js +146 -0
- package/dist/text/fonts/glyph-pbf.js.map +1 -0
- package/dist/text/fonts/glyph-range-loader.cjs +121 -0
- package/dist/text/fonts/glyph-range-loader.d.ts +38 -0
- package/dist/text/fonts/glyph-range-loader.d.ts.map +1 -0
- package/dist/text/fonts/glyph-range-loader.js +116 -0
- package/dist/text/fonts/glyph-range-loader.js.map +1 -0
- package/dist/text/fonts/helvetiker.cjs +1307 -0
- package/dist/text/fonts/helvetiker.d.ts +4 -0
- package/dist/text/fonts/helvetiker.d.ts.map +1 -0
- package/dist/text/fonts/helvetiker.js +1288 -0
- package/dist/text/fonts/helvetiker.js.map +1 -0
- package/dist/text/fonts/index.cjs +72 -0
- package/dist/text/fonts/index.cjs.map +6 -0
- package/dist/text/fonts/index.d.ts +13 -0
- package/dist/text/fonts/index.d.ts.map +1 -0
- package/dist/text/fonts/index.js +14 -0
- package/dist/text/fonts/index.js.map +1 -0
- package/dist/text/fonts/typeface-font-data.cjs +15 -0
- package/dist/text/fonts/typeface-font-data.d.ts +38 -0
- package/dist/text/fonts/typeface-font-data.d.ts.map +1 -0
- package/dist/text/fonts/typeface-font-data.js +6 -0
- package/dist/text/fonts/typeface-font-data.js.map +1 -0
- package/dist/text/index.cjs +21 -0
- package/dist/text/index.cjs.map +6 -0
- package/dist/text/index.d.ts +2 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +5 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/text-2d/dictionary-text-renderer.cjs +160 -0
- package/dist/text/text-2d/dictionary-text-renderer.d.ts +50 -0
- package/dist/text/text-2d/dictionary-text-renderer.d.ts.map +1 -0
- package/dist/text/text-2d/dictionary-text-renderer.js +145 -0
- package/dist/text/text-2d/dictionary-text-renderer.js.map +1 -0
- package/dist/text/text-2d/experimental.cjs +72 -0
- package/dist/text/text-2d/experimental.d.ts +17 -0
- package/dist/text/text-2d/experimental.d.ts.map +1 -0
- package/dist/text/text-2d/experimental.js +20 -0
- package/dist/text/text-2d/experimental.js.map +1 -0
- package/dist/text/text-2d/gpu-text-data.cjs +112 -0
- package/dist/text/text-2d/gpu-text-data.d.ts +108 -0
- package/dist/text/text-2d/gpu-text-data.d.ts.map +1 -0
- package/dist/text/text-2d/gpu-text-data.js +92 -0
- package/dist/text/text-2d/gpu-text-data.js.map +1 -0
- package/dist/text/text-2d/gpu-text-resources.cjs +55 -0
- package/dist/text/text-2d/gpu-text-resources.d.ts +30 -0
- package/dist/text/text-2d/gpu-text-resources.d.ts.map +1 -0
- package/dist/text/text-2d/gpu-text-resources.js +40 -0
- package/dist/text/text-2d/gpu-text-resources.js.map +1 -0
- package/dist/text/text-2d/index.cjs +69 -0
- package/dist/text/text-2d/index.d.ts +15 -0
- package/dist/text/text-2d/index.d.ts.map +1 -0
- package/dist/text/text-2d/index.js +15 -0
- package/dist/text/text-2d/index.js.map +1 -0
- package/dist/text/text-2d/model-utils/gpu-text-expansion.cjs +859 -0
- package/dist/text/text-2d/model-utils/gpu-text-expansion.d.ts +196 -0
- package/dist/text/text-2d/model-utils/gpu-text-expansion.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/gpu-text-expansion.js +843 -0
- package/dist/text/text-2d/model-utils/gpu-text-expansion.js.map +1 -0
- package/dist/text/text-2d/model-utils/gpu-text-types.cjs +15 -0
- package/dist/text/text-2d/model-utils/gpu-text-types.d.ts +114 -0
- package/dist/text/text-2d/model-utils/gpu-text-types.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/gpu-text-types.js +5 -0
- package/dist/text/text-2d/model-utils/gpu-text-types.js.map +1 -0
- package/dist/text/text-2d/model-utils/gpu-utf8-map.cjs +134 -0
- package/dist/text/text-2d/model-utils/gpu-utf8-map.d.ts +39 -0
- package/dist/text/text-2d/model-utils/gpu-utf8-map.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/gpu-utf8-map.js +118 -0
- package/dist/text/text-2d/model-utils/gpu-utf8-map.js.map +1 -0
- package/dist/text/text-2d/model-utils/text-fragment-shaders.cjs +97 -0
- package/dist/text/text-2d/model-utils/text-fragment-shaders.d.ts +23 -0
- package/dist/text/text-2d/model-utils/text-fragment-shaders.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-fragment-shaders.js +81 -0
- package/dist/text/text-2d/model-utils/text-fragment-shaders.js.map +1 -0
- package/dist/text/text-2d/model-utils/text-fragment-uniforms.cjs +50 -0
- package/dist/text/text-2d/model-utils/text-fragment-uniforms.d.ts +13 -0
- package/dist/text/text-2d/model-utils/text-fragment-uniforms.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-fragment-uniforms.js +25 -0
- package/dist/text/text-2d/model-utils/text-fragment-uniforms.js.map +1 -0
- package/dist/text/text-2d/model-utils/text-layout.cjs +300 -0
- package/dist/text/text-2d/model-utils/text-layout.d.ts +61 -0
- package/dist/text/text-2d/model-utils/text-layout.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-layout.js +282 -0
- package/dist/text/text-2d/model-utils/text-layout.js.map +1 -0
- package/dist/text/text-2d/model-utils/text-model-props.cjs +184 -0
- package/dist/text/text-2d/model-utils/text-model-props.d.ts +206 -0
- package/dist/text/text-2d/model-utils/text-model-props.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-model-props.js +158 -0
- package/dist/text/text-2d/model-utils/text-model-props.js.map +1 -0
- package/dist/text/text-2d/model-utils/text-shaders.cjs +692 -0
- package/dist/text/text-2d/model-utils/text-shaders.d.ts +26 -0
- package/dist/text/text-2d/model-utils/text-shaders.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-shaders.js +618 -0
- package/dist/text/text-2d/model-utils/text-shaders.js.map +1 -0
- package/dist/text/text-2d/model-utils/text-storage-model-draw.cjs +53 -0
- package/dist/text/text-2d/model-utils/text-storage-model-draw.d.ts +16 -0
- package/dist/text/text-2d/model-utils/text-storage-model-draw.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-storage-model-draw.js +45 -0
- package/dist/text/text-2d/model-utils/text-storage-model-draw.js.map +1 -0
- package/dist/text/text-2d/model-utils/text-storage-model-utils.cjs +56 -0
- package/dist/text/text-2d/model-utils/text-storage-model-utils.d.ts +25 -0
- package/dist/text/text-2d/model-utils/text-storage-model-utils.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-storage-model-utils.js +39 -0
- package/dist/text/text-2d/model-utils/text-storage-model-utils.js.map +1 -0
- package/dist/text/text-2d/model-utils/text-storage-state.cjs +68 -0
- package/dist/text/text-2d/model-utils/text-storage-state.d.ts +153 -0
- package/dist/text/text-2d/model-utils/text-storage-state.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-storage-state.js +38 -0
- package/dist/text/text-2d/model-utils/text-storage-state.js.map +1 -0
- package/dist/text/text-2d/models/text-attribute-model.cjs +79 -0
- package/dist/text/text-2d/models/text-attribute-model.d.ts +111 -0
- package/dist/text/text-2d/models/text-attribute-model.d.ts.map +1 -0
- package/dist/text/text-2d/models/text-attribute-model.js +68 -0
- package/dist/text/text-2d/models/text-attribute-model.js.map +1 -0
- package/dist/text/text-2d/models/text-dictionary-model.cjs +115 -0
- package/dist/text/text-2d/models/text-dictionary-model.d.ts +95 -0
- package/dist/text/text-2d/models/text-dictionary-model.d.ts.map +1 -0
- package/dist/text/text-2d/models/text-dictionary-model.js +100 -0
- package/dist/text/text-2d/models/text-dictionary-model.js.map +1 -0
- package/dist/text/text-2d/models/text-storage-model.cjs +165 -0
- package/dist/text/text-2d/models/text-storage-model.d.ts +94 -0
- package/dist/text/text-2d/models/text-storage-model.d.ts.map +1 -0
- package/dist/text/text-2d/models/text-storage-model.js +162 -0
- package/dist/text/text-2d/models/text-storage-model.js.map +1 -0
- package/dist/text/text-2d/text-renderer.cjs +181 -0
- package/dist/text/text-2d/text-renderer.d.ts +56 -0
- package/dist/text/text-2d/text-renderer.d.ts.map +1 -0
- package/dist/text/text-2d/text-renderer.js +164 -0
- package/dist/text/text-2d/text-renderer.js.map +1 -0
- package/dist/text/text-3d/extrude.cjs +380 -0
- package/dist/text/text-3d/extrude.d.ts +34 -0
- package/dist/text/text-3d/extrude.d.ts.map +1 -0
- package/dist/text/text-3d/extrude.js +390 -0
- package/dist/text/text-3d/extrude.js.map +1 -0
- package/dist/text/text-3d/font.cjs +184 -0
- package/dist/text/text-3d/font.d.ts +32 -0
- package/dist/text/text-3d/font.d.ts.map +1 -0
- package/dist/text/text-3d/font.js +174 -0
- package/dist/text/text-3d/font.js.map +1 -0
- package/dist/text/text-3d/glyph-atlas.cjs +190 -0
- package/dist/text/text-3d/glyph-atlas.d.ts +97 -0
- package/dist/text/text-3d/glyph-atlas.d.ts.map +1 -0
- package/dist/text/text-3d/glyph-atlas.js +178 -0
- package/dist/text/text-3d/glyph-atlas.js.map +1 -0
- package/dist/text/text-3d/index.cjs +48 -0
- package/dist/text/text-3d/index.cjs.map +6 -0
- package/dist/text/text-3d/index.d.ts +7 -0
- package/dist/text/text-3d/index.d.ts.map +1 -0
- package/dist/text/text-3d/index.js +12 -0
- package/dist/text/text-3d/index.js.map +1 -0
- package/dist/text/text-3d/paths/curve-path.cjs +50 -0
- package/dist/text/text-3d/paths/curve-path.d.ts +11 -0
- package/dist/text/text-3d/paths/curve-path.d.ts.map +1 -0
- package/dist/text/text-3d/paths/curve-path.js +31 -0
- package/dist/text/text-3d/paths/curve-path.js.map +1 -0
- package/dist/text/text-3d/paths/curves.cjs +151 -0
- package/dist/text/text-3d/paths/curves.d.ts +60 -0
- package/dist/text/text-3d/paths/curves.d.ts.map +1 -0
- package/dist/text/text-3d/paths/curves.js +132 -0
- package/dist/text/text-3d/paths/curves.js.map +1 -0
- package/dist/text/text-3d/paths/path.cjs +106 -0
- package/dist/text/text-3d/paths/path.d.ts +36 -0
- package/dist/text/text-3d/paths/path.d.ts.map +1 -0
- package/dist/text/text-3d/paths/path.js +86 -0
- package/dist/text/text-3d/paths/path.js.map +1 -0
- package/dist/text/text-3d/paths/shape-path.cjs +150 -0
- package/dist/text/text-3d/paths/shape-path.d.ts +22 -0
- package/dist/text/text-3d/paths/shape-path.d.ts.map +1 -0
- package/dist/text/text-3d/paths/shape-path.js +137 -0
- package/dist/text/text-3d/paths/shape-path.js.map +1 -0
- package/dist/text/text-3d/paths/shape-utils.cjs +78 -0
- package/dist/text/text-3d/paths/shape-utils.d.ts +11 -0
- package/dist/text/text-3d/paths/shape-utils.d.ts.map +1 -0
- package/dist/text/text-3d/paths/shape-utils.js +63 -0
- package/dist/text/text-3d/paths/shape-utils.js.map +1 -0
- package/dist/text/text-3d/text-geometry.cjs +69 -0
- package/dist/text/text-3d/text-geometry.d.ts +20 -0
- package/dist/text/text-3d/text-geometry.d.ts.map +1 -0
- package/dist/text/text-3d/text-geometry.js +53 -0
- package/dist/text/text-3d/text-geometry.js.map +1 -0
- package/dist/utils/shader-module-utils.cjs +3 -3
- package/dist/utils/shader-module-utils.d.ts +1 -1
- package/dist/utils/shader-module-utils.d.ts.map +1 -1
- package/dist/utils/shader-module-utils.js +1 -1
- package/dist/utils/shader-module-utils.js.map +1 -1
- package/package.json +58 -6
- package/src/arrow/arrow-geometry.ts +491 -0
- package/src/arrow/arrow-mesh-types.ts +41 -0
- package/src/arrow/arrow-picking.ts +217 -0
- package/src/arrow/index.ts +247 -0
- package/src/arrow/renderers/arrow-renderer-utils.ts +205 -0
- package/src/arrow/renderers/path/conversion/arrow-path-gpu-vectors.ts +1349 -0
- package/src/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.ts +321 -0
- package/src/arrow/renderers/path/renderers/arrow-path-renderer.ts +159 -0
- package/src/arrow/renderers/path/source/arrow-path-source-mapping.ts +175 -0
- package/src/arrow/renderers/path/transforms/close-arrow-paths.ts +778 -0
- package/src/arrow/renderers/path/transforms/gpu-path-float64-deltas.ts +304 -0
- package/src/arrow/renderers/path/transforms/path-view-origins.ts +92 -0
- package/src/arrow/renderers/polygon/conversion/arrow-polygon-gpu-vectors.ts +265 -0
- package/src/arrow/renderers/polygon/renderers/arrow-polygon-renderer.ts +592 -0
- package/src/arrow/renderers/polygon/source/arrow-polygon-source-mapping.ts +116 -0
- package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-arrow.ts +486 -0
- package/src/arrow/renderers/text/conversion/arrow-text.ts +930 -0
- package/src/arrow/renderers/text/conversion/convert-arrow-text-to-attribute.ts +224 -0
- package/src/arrow/renderers/text/conversion/convert-arrow-text-to-dictionary.ts +65 -0
- package/src/arrow/renderers/text/conversion/convert-arrow-text-to-storage.ts +98 -0
- package/src/arrow/renderers/text/conversion/convert-arrow-text-vectors.ts +3569 -0
- package/src/arrow/renderers/text/conversion/index.ts +83 -0
- package/src/arrow/renderers/text/conversion/make-gpu-text-data-from-arrow.ts +275 -0
- package/src/arrow/renderers/text/renderers/arrow-text-picking.ts +166 -0
- package/src/arrow/renderers/text/renderers/arrow-text-renderer.ts +1605 -0
- package/src/arrow/renderers/text/renderers/arrow-text-shaders.ts +1001 -0
- package/src/arrow/renderers/text/source/arrow-text-source-mapping.ts +221 -0
- package/src/arrow/renderers/text/source/index.ts +15 -0
- package/src/compute/buffer-transform.ts +1 -1
- package/src/compute/computation.ts +15 -8
- package/src/compute/texture-transform.ts +1 -1
- package/src/effects/README.md +165 -0
- package/src/effects/index.ts +210 -0
- package/src/effects/passes/postprocessing/fxaa/fxaa.ts +982 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +80 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/denoise.ts +109 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/huesaturation.ts +114 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/noise.ts +75 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/persistence.ts +53 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/sepia.ts +81 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/tone-mapping.ts +89 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/vibrance.ts +69 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/vignette.ts +77 -0
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-composite-shader-pass.ts +1160 -0
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-compute-pyramid.ts +165 -0
- package/src/effects/passes/postprocessing/image-blur-filters/bloom-lens-effects.ts +646 -0
- package/src/effects/passes/postprocessing/image-blur-filters/bloom.ts +129 -0
- package/src/effects/passes/postprocessing/image-blur-filters/gaussianblur.ts +196 -0
- package/src/effects/passes/postprocessing/image-blur-filters/tiltshift.ts +188 -0
- package/src/effects/passes/postprocessing/image-blur-filters/triangleblur.ts +133 -0
- package/src/effects/passes/postprocessing/image-blur-filters/zoomblur.ts +108 -0
- package/src/effects/passes/postprocessing/image-fun-filters/colorhalftone.ts +128 -0
- package/src/effects/passes/postprocessing/image-fun-filters/dotscreen.ts +99 -0
- package/src/effects/passes/postprocessing/image-fun-filters/edgework.ts +226 -0
- package/src/effects/passes/postprocessing/image-fun-filters/hexagonalpixelate.ts +147 -0
- package/src/effects/passes/postprocessing/image-fun-filters/ink.ts +115 -0
- package/src/effects/passes/postprocessing/image-fun-filters/magnify.ts +108 -0
- package/src/effects/passes/postprocessing/image-warp-filters/bulgepinch.ts +119 -0
- package/src/effects/passes/postprocessing/image-warp-filters/swirl.ts +115 -0
- package/src/effects/passes/postprocessing/image-warp-filters/warp.ts +46 -0
- package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +235 -0
- package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +784 -0
- package/src/effects/passes/screen-space/copy-pass.ts +14 -0
- package/src/effects/passes/screen-space/depth-aware-blur.ts +102 -0
- package/src/effects/passes/screen-space/dof.ts +285 -0
- package/src/effects/passes/screen-space/gtao.ts +575 -0
- package/src/effects/passes/screen-space/hdr-auto-exposure.ts +348 -0
- package/src/effects/passes/screen-space/height-fog.ts +144 -0
- package/src/effects/passes/screen-space/motion-blur.ts +61 -0
- package/src/effects/passes/screen-space/outlines.ts +97 -0
- package/src/effects/passes/screen-space/screen-space-global-illumination.ts +590 -0
- package/src/effects/passes/screen-space/screen-space-reflections.ts +754 -0
- package/src/effects/passes/screen-space/screen-space-shader-helpers.ts +85 -0
- package/src/effects/passes/screen-space/selection-outline.ts +68 -0
- package/src/effects/passes/screen-space/ssao.ts +167 -0
- package/src/effects/passes/screen-space/ssr-camera-temporal.ts +172 -0
- package/src/effects/passes/screen-space/temporal-antialiasing.ts +120 -0
- package/src/effects/passes/screen-space/volumetric-fog.ts +102 -0
- package/src/experimental/materials/emissive-material.ts +1 -1
- package/src/experimental/materials/glass-material.ts +1 -1
- package/src/experimental/materials/glass-transmission.ts +1 -1
- package/src/experimental/materials/optical-caustics.ts +1 -1
- package/src/experimental/materials/optical-lighting.ts +1 -1
- package/src/experimental/materials/optical-point-lights.ts +1 -1
- package/src/experimental/materials/reflective-material.ts +1 -1
- package/src/gltf/README.md +48 -0
- package/src/gltf/gltf/animations/animations.ts +160 -0
- package/src/gltf/gltf/create-gltf-model.ts +957 -0
- package/src/gltf/gltf/create-scenegraph-from-gltf.ts +282 -0
- package/src/gltf/gltf/gltf-animated-crowd.ts +1338 -0
- package/src/gltf/gltf/gltf-animator.ts +259 -0
- package/src/gltf/gltf/gltf-area-lights.ts +55 -0
- package/src/gltf/gltf/gltf-audio.ts +145 -0
- package/src/gltf/gltf/gltf-billboard.ts +49 -0
- package/src/gltf/gltf/gltf-extension-support.ts +483 -0
- package/src/gltf/gltf/gltf-gpu-animation.ts +80 -0
- package/src/gltf/gltf/gltf-instancing.ts +130 -0
- package/src/gltf/gltf/gltf-lightmap.ts +136 -0
- package/src/gltf/gltf/gltf-lod.ts +355 -0
- package/src/gltf/gltf/gltf-material-variants.ts +42 -0
- package/src/gltf/gltf/gltf-materials-scatter.ts +55 -0
- package/src/gltf/gltf/gltf-skin.ts +127 -0
- package/src/gltf/gltf/morph-targets.ts +9 -0
- package/src/gltf/index.ts +189 -0
- package/src/gltf/parsers/gltf-accessor-utils.ts +85 -0
- package/src/gltf/parsers/parse-gltf-animations.ts +813 -0
- package/src/gltf/parsers/parse-gltf-joints.ts +145 -0
- package/src/gltf/parsers/parse-gltf-lights.ts +276 -0
- package/src/gltf/parsers/parse-gltf-physics-pointer.ts +32 -0
- package/src/gltf/parsers/parse-gltf.ts +655 -0
- package/src/gltf/parsers/parse-pbr-material.ts +1664 -0
- package/src/gltf/parsers/post-process-gltf.ts +756 -0
- package/src/gltf/pbr/pbr-environment.ts +130 -0
- package/src/gltf/pbr/pbr-material.ts +32 -0
- package/src/gltf/pbr/texture-transform.ts +261 -0
- package/src/gltf/physics/README.md +164 -0
- package/src/gltf/physics/export-state.ts +224 -0
- package/src/gltf/physics/index.ts +100 -0
- package/src/gltf/physics/mesh-box-shape.ts +44 -0
- package/src/gltf/physics/mesh-snapshot.ts +230 -0
- package/src/gltf/physics/node-collision-geometry.ts +98 -0
- package/src/gltf/physics/parse-gltf-physics.ts +918 -0
- package/src/gltf/physics/parse-physics-joints.ts +69 -0
- package/src/gltf/physics/physics-transforms.ts +11 -0
- package/src/gltf/physics/physics-types.ts +126 -0
- package/src/gltf/physics/property-bindings.ts +168 -0
- package/src/gltf/physics/scene-bindings.ts +46 -0
- package/src/gltf/physics/snapshot-scene.ts +31 -0
- package/src/gltf/types/gltf-json-schema.ts +930 -0
- package/src/gltf/types/gltf-postprocessed-schema.ts +788 -0
- package/src/gltf/types/gltf-shape-schema.ts +48 -0
- package/src/gltf/types/gltf-types.ts +102 -0
- package/src/gltf/webgl-to-webgpu/convert-webgl-sampler.ts +151 -0
- package/src/gltf/webgl-to-webgpu/convert-webgl-topology.ts +81 -0
- package/src/gltf/webgl-to-webgpu/gltf-webgl-constants.ts +36 -0
- package/src/graph/models/polygon/polygon-shaders.ts +1 -1
- package/src/index.ts +2 -0
- package/src/lighting/LTC-LICENSE.txt +31 -0
- package/src/lighting/ltc-data.ts +3277 -0
- package/src/lighting/ltc-textures.ts +30 -0
- package/src/material/material-factory.ts +1 -1
- package/src/material/material.ts +1 -1
- package/src/model/gpu-vector-model.ts +13 -18
- package/src/model/split-uniforms-and-bindings.ts +1 -1
- package/src/models/billboard-texture-model.ts +1 -1
- package/src/models/billboard-texture-module.ts +1 -1
- package/src/models/light-model-utils.ts +1 -7
- package/src/modules/picking/color-picking.ts +1 -1
- package/src/modules/picking/index-color-picking.ts +1 -1
- package/src/modules/picking/index-picking.ts +1 -1
- package/src/modules/picking/legacy-color-picking.ts +2 -2
- package/src/modules/picking/legacy-picking-manager.ts +1 -1
- package/src/modules/picking/picking-uniforms.ts +1 -1
- package/src/modules/picking/picking.ts +1 -1
- package/src/passes/get-fragment-shader.ts +1 -1
- package/src/passes/shader-pass-renderer.ts +2 -2
- package/src/passes/texture-transform-module.ts +1 -1
- package/src/scenegraph/controllers/area-light-controller.ts +1 -1
- package/src/scenegraph/published-transforms.ts +1 -1
- package/src/shader-inputs.ts +1 -1
- package/src/splats/README.md +43 -0
- package/src/splats/gpu-paged-splat-renderer.ts +1637 -0
- package/src/splats/gpu-paged-splat-shaders.ts +397 -0
- package/src/splats/gpu-splat-graph-interaction.ts +600 -0
- package/src/splats/gpu-splat-graph-renderer.ts +1150 -0
- package/src/splats/gpu-splat-graph-shaders.ts +520 -0
- package/src/splats/index.ts +136 -0
- package/src/splats/splat-covariance.ts +199 -0
- package/src/splats/splat-data.ts +433 -0
- package/src/splats/splat-filter.ts +59 -0
- package/src/splats/splat-gltf.ts +388 -0
- package/src/splats/splat-hierarchy.ts +670 -0
- package/src/splats/splat-picking.ts +616 -0
- package/src/splats/splat-rad-hierarchy.ts +2927 -0
- package/src/splats/splat-renderer.ts +1281 -0
- package/src/splats/splat-residency.ts +673 -0
- package/src/splats/splat-shaders.ts +476 -0
- package/src/splats/splat-sort.ts +173 -0
- package/src/splats/splat-spherical-harmonics.ts +99 -0
- package/src/text/README.md +127 -0
- package/src/text/experimental.ts +5 -0
- package/src/text/fonts/atlas/browser-font-atlas.ts +289 -0
- package/src/text/fonts/atlas/font-atlas.ts +55 -0
- package/src/text/fonts/atlas/lru-cache.ts +37 -0
- package/src/text/fonts/atlas/text-glyph-walker.ts +124 -0
- package/src/text/fonts/atlas/text-metrics.ts +40 -0
- package/src/text/fonts/atlas/text-utils.ts +146 -0
- package/src/text/fonts/build-bitmap-font-atlas.ts +29 -0
- package/src/text/fonts/build-glyph-font-atlas.ts +74 -0
- package/src/text/fonts/build-msdf-font-atlas.ts +229 -0
- package/src/text/fonts/build-sdf-font-atlas.ts +100 -0
- package/src/text/fonts/glyph-pbf.ts +164 -0
- package/src/text/fonts/glyph-range-loader.ts +143 -0
- package/src/text/fonts/helvetiker.ts +1291 -0
- package/src/text/fonts/index.ts +58 -0
- package/src/text/fonts/typeface-font-data.ts +43 -0
- package/src/text/index.ts +5 -0
- package/src/text/text-2d/dictionary-text-renderer.ts +193 -0
- package/src/text/text-2d/experimental.ts +57 -0
- package/src/text/text-2d/gpu-text-data.ts +198 -0
- package/src/text/text-2d/gpu-text-resources.ts +54 -0
- package/src/text/text-2d/index.ts +49 -0
- package/src/text/text-2d/model-utils/gpu-text-expansion.ts +1187 -0
- package/src/text/text-2d/model-utils/gpu-text-types.ts +121 -0
- package/src/text/text-2d/model-utils/gpu-utf8-map.ts +150 -0
- package/src/text/text-2d/model-utils/text-fragment-shaders.ts +119 -0
- package/src/text/text-2d/model-utils/text-fragment-uniforms.ts +46 -0
- package/src/text/text-2d/model-utils/text-layout.ts +463 -0
- package/src/text/text-2d/model-utils/text-model-props.ts +242 -0
- package/src/text/text-2d/model-utils/text-shaders.ts +640 -0
- package/src/text/text-2d/model-utils/text-storage-model-draw.ts +64 -0
- package/src/text/text-2d/model-utils/text-storage-model-utils.ts +68 -0
- package/src/text/text-2d/model-utils/text-storage-state.ts +216 -0
- package/src/text/text-2d/models/text-attribute-model.ts +147 -0
- package/src/text/text-2d/models/text-dictionary-model.ts +187 -0
- package/src/text/text-2d/models/text-storage-model.ts +254 -0
- package/src/text/text-2d/text-renderer.ts +199 -0
- package/src/text/text-3d/extrude.ts +518 -0
- package/src/text/text-3d/font.ts +244 -0
- package/src/text/text-3d/glyph-atlas.ts +330 -0
- package/src/text/text-3d/index.ts +28 -0
- package/src/text/text-3d/paths/curve-path.ts +34 -0
- package/src/text/text-3d/paths/curves.ts +167 -0
- package/src/text/text-3d/paths/path.ts +114 -0
- package/src/text/text-3d/paths/shape-path.ts +180 -0
- package/src/text/text-3d/paths/shape-utils.ts +78 -0
- package/src/text/text-3d/text-geometry.ts +72 -0
- package/src/utils/shader-module-utils.ts +1 -1
|
@@ -0,0 +1,2133 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var convert_arrow_text_vectors_exports = {};
|
|
19
|
+
__export(convert_arrow_text_vectors_exports, {
|
|
20
|
+
appendArrowTextStorageStateBatches: () => appendArrowTextStorageStateBatches,
|
|
21
|
+
appendTextGlyphLayout: () => appendTextGlyphLayout,
|
|
22
|
+
assertArrowTextVectorBatchAlignment: () => assertArrowTextVectorBatchAlignment,
|
|
23
|
+
assertArrowTextVectorTypes: () => assertArrowTextVectorTypes,
|
|
24
|
+
buildArrowTextGlyphTable: () => buildArrowTextGlyphTable,
|
|
25
|
+
createArrowTextAttributeState: () => createArrowTextAttributeState,
|
|
26
|
+
createArrowTextDictionaryStorageState: () => createArrowTextDictionaryStorageState,
|
|
27
|
+
createArrowTextRenderTable: () => createArrowTextRenderTable,
|
|
28
|
+
createArrowTextStorageState: () => createArrowTextStorageState,
|
|
29
|
+
createExpandedGlyphVertexData: () => createExpandedGlyphVertexData,
|
|
30
|
+
createTextStorageStateFromGPUVectors: () => createTextStorageStateFromGPUVectors,
|
|
31
|
+
packTextStorageClipRects: () => packTextStorageClipRects,
|
|
32
|
+
refreshArrowTextDictionaryStorageRowBindings: () => refreshArrowTextDictionaryStorageRowBindings,
|
|
33
|
+
refreshArrowTextStorageRowBindings: () => refreshArrowTextStorageRowBindings,
|
|
34
|
+
resolveArrowTextBatchInputs: () => resolveArrowTextBatchInputs,
|
|
35
|
+
resolveArrowTextShaderLayout: () => resolveArrowTextShaderLayout
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(convert_arrow_text_vectors_exports);
|
|
38
|
+
var import_core = require("@luma.gl/core");
|
|
39
|
+
var import_gpu_tables = require("@luma.gl/graph/gpu-tables");
|
|
40
|
+
var import_arrow = require("@luma.gl/gpgpu/arrow");
|
|
41
|
+
var import_arrow2 = require("@luma.gl/gpgpu/arrow");
|
|
42
|
+
var import_arrow3 = require("@luma.gl/graph/arrow");
|
|
43
|
+
var import_arrow4 = require("@luma.gl/gpgpu/arrow");
|
|
44
|
+
var import_arrow5 = require("@luma.gl/gpgpu/_internal/arrow");
|
|
45
|
+
var import_arrow6 = require("@luma.gl/gpgpu/arrow");
|
|
46
|
+
var import_dynamic = require("@luma.gl/core/dynamic");
|
|
47
|
+
var import_apache_arrow = require("apache-arrow");
|
|
48
|
+
var import_text_experimental = require("@luma.gl/engine/text-experimental");
|
|
49
|
+
var import_arrow_text = require("./arrow-text.cjs");
|
|
50
|
+
const GLYPH_OFFSETS_COLUMN = "glyphOffsets";
|
|
51
|
+
const GLYPH_FRAMES_COLUMN = "glyphFrames";
|
|
52
|
+
const GLYPH_PAGES_COLUMN = "glyphPages";
|
|
53
|
+
const GLYPH_CLIP_RECTS_COLUMN = "glyphClipRects";
|
|
54
|
+
const ROW_INDICES_COLUMN = "rowIndices";
|
|
55
|
+
const EXPANDED_GLYPH_VERTEX_DATA = "expandedGlyphVertexData";
|
|
56
|
+
const COMPACT_GLYPH_VERTEX_BYTE_STRIDE = Uint32Array.BYTES_PER_ELEMENT * 2;
|
|
57
|
+
const EXPANDED_GLYPH_VERTEX_BYTE_STRIDE = Uint32Array.BYTES_PER_ELEMENT * 5;
|
|
58
|
+
const CLIPPED_EXPANDED_GLYPH_VERTEX_BYTE_STRIDE = EXPANDED_GLYPH_VERTEX_BYTE_STRIDE + Float32Array.BYTES_PER_ELEMENT * 4;
|
|
59
|
+
const DEFAULT_TEXT_STORAGE_COLOR = [0, 0, 0, 255];
|
|
60
|
+
const DEFAULT_TEXT_STORAGE_ANGLE = 0;
|
|
61
|
+
const DEFAULT_TEXT_STORAGE_SIZE = 32;
|
|
62
|
+
const DEFAULT_TEXT_STORAGE_PIXEL_OFFSET = [0, 0];
|
|
63
|
+
const DEFAULT_TEXT_STORAGE_ANCHOR = 0;
|
|
64
|
+
const DEFAULT_STORAGE_ALIGNMENT_BASELINE = 0;
|
|
65
|
+
const BITMAP_TEXT_SDF_THRESHOLD = -1;
|
|
66
|
+
const INVALID_DICTIONARY_INDEX = 4294967295;
|
|
67
|
+
const STORAGE_RENDER_CONFIG_BYTE_LENGTH = Uint32Array.BYTES_PER_ELEMENT * 4;
|
|
68
|
+
const TEXT_DICTIONARY_RENDER_CONFIG_BYTE_LENGTH = Uint32Array.BYTES_PER_ELEMENT * 4;
|
|
69
|
+
function buildArrowTextGlyphTable(props) {
|
|
70
|
+
if (props.labelTable.numRows !== props.texts.length) {
|
|
71
|
+
throw new Error("ArrowTextModel requires labelTable rows to match UTF-8 text rows");
|
|
72
|
+
}
|
|
73
|
+
assertClipRects(props.clipRects, props.texts.length);
|
|
74
|
+
assertColumnAvailable(props.labelTable, GLYPH_OFFSETS_COLUMN);
|
|
75
|
+
assertColumnAvailable(props.labelTable, GLYPH_FRAMES_COLUMN);
|
|
76
|
+
assertColumnAvailable(props.labelTable, GLYPH_PAGES_COLUMN);
|
|
77
|
+
assertColumnAvailable(props.labelTable, GLYPH_CLIP_RECTS_COLUMN);
|
|
78
|
+
assertColumnAvailable(props.labelTable, ROW_INDICES_COLUMN);
|
|
79
|
+
const glyphAttributeBuildStartTime = getNow();
|
|
80
|
+
const glyphLayout = (0, import_arrow_text.buildArrowGlyphLayout)({
|
|
81
|
+
texts: props.texts,
|
|
82
|
+
fontAtlas: props.fontAtlas,
|
|
83
|
+
lineHeight: props.lineHeight,
|
|
84
|
+
characterSet: props.characterSet
|
|
85
|
+
});
|
|
86
|
+
const fields = [];
|
|
87
|
+
const columns = {};
|
|
88
|
+
const glyphRowIndices = makeGlyphRowIndices(glyphLayout.startIndices);
|
|
89
|
+
for (const field of props.labelTable.schema.fields) {
|
|
90
|
+
const vector = props.labelTable.getChild(field.name);
|
|
91
|
+
if (!vector) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (field.name === "colors" && isArrowTextCharacterColorType(vector.type)) {
|
|
95
|
+
fields.push(new import_apache_arrow.Field(field.name, vector.type.children[0].type, field.nullable, field.metadata));
|
|
96
|
+
columns[field.name] = expandArrowTextCharacterColorRows(vector, glyphLayout.startIndices, props.color);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (!isInstanceCompatibleArrowType(vector.type)) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
fields.push(field);
|
|
103
|
+
columns[field.name] = (0, import_arrow.expandArrowVector)(vector, glyphRowIndices, getArrowTextExpansionNullValue(field.name, props));
|
|
104
|
+
}
|
|
105
|
+
fields.push(makeFixedSizeListField(GLYPH_OFFSETS_COLUMN, new import_apache_arrow.Int16(), 2));
|
|
106
|
+
fields.push(makeFixedSizeListField(GLYPH_FRAMES_COLUMN, new import_apache_arrow.Uint16(), 4));
|
|
107
|
+
fields.push(new import_apache_arrow.Field(GLYPH_PAGES_COLUMN, new import_apache_arrow.Uint16(), false));
|
|
108
|
+
if (props.clipRects) {
|
|
109
|
+
fields.push(makeFixedSizeListField(GLYPH_CLIP_RECTS_COLUMN, new import_apache_arrow.Int16(), 4));
|
|
110
|
+
}
|
|
111
|
+
fields.push(new import_apache_arrow.Field(ROW_INDICES_COLUMN, new import_apache_arrow.Uint32(), false));
|
|
112
|
+
columns[GLYPH_OFFSETS_COLUMN] = (0, import_arrow2.makeArrowFixedSizeListVector)(new import_apache_arrow.Int16(), 2, glyphLayout.glyphOffsets);
|
|
113
|
+
columns[GLYPH_FRAMES_COLUMN] = (0, import_arrow2.makeArrowFixedSizeListVector)(new import_apache_arrow.Uint16(), 4, glyphLayout.glyphFrames);
|
|
114
|
+
columns[GLYPH_PAGES_COLUMN] = makeNumericArrowVector(new import_apache_arrow.Uint16(), glyphLayout.glyphPages);
|
|
115
|
+
if (props.clipRects) {
|
|
116
|
+
columns[GLYPH_CLIP_RECTS_COLUMN] = (0, import_arrow.expandArrowVector)(props.clipRects, glyphRowIndices);
|
|
117
|
+
}
|
|
118
|
+
columns[ROW_INDICES_COLUMN] = makeNumericArrowVector(new import_apache_arrow.Uint32(), makeGlyphRowIndices(glyphLayout.startIndices, props.rowIndexBase));
|
|
119
|
+
const attributeByteLength = getGeneratedAttributeByteLength(columns);
|
|
120
|
+
const glyphAttributeBuildTimeMs = getNow() - glyphAttributeBuildStartTime;
|
|
121
|
+
return {
|
|
122
|
+
table: new import_apache_arrow.Table(new import_apache_arrow.Schema(fields, props.labelTable.schema.metadata), columns),
|
|
123
|
+
glyphLayout,
|
|
124
|
+
characterSet: props.characterSet,
|
|
125
|
+
attributeByteLength,
|
|
126
|
+
glyphAttributeBuildTimeMs
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function resolveArrowTextInputs(props) {
|
|
130
|
+
if (!props.sourceVectors) {
|
|
131
|
+
throw new Error("ArrowTextModel requires explicit sourceVectors for CPU glyph expansion");
|
|
132
|
+
}
|
|
133
|
+
assertArrowTextVectorTypes(props);
|
|
134
|
+
assertArrowTextVectorRowAlignment(props);
|
|
135
|
+
assertArrowTextSourceVectorAlignment(props);
|
|
136
|
+
const { sourceVectors } = props;
|
|
137
|
+
const columns = {
|
|
138
|
+
positions: sourceVectors.positions
|
|
139
|
+
};
|
|
140
|
+
if (sourceVectors.colors) {
|
|
141
|
+
columns["colors"] = sourceVectors.colors;
|
|
142
|
+
}
|
|
143
|
+
if (sourceVectors.angles) {
|
|
144
|
+
columns["angles"] = sourceVectors.angles;
|
|
145
|
+
}
|
|
146
|
+
if (sourceVectors.sizes) {
|
|
147
|
+
columns["sizes"] = sourceVectors.sizes;
|
|
148
|
+
}
|
|
149
|
+
if (sourceVectors.pixelOffsets) {
|
|
150
|
+
columns["pixelOffsets"] = sourceVectors.pixelOffsets;
|
|
151
|
+
}
|
|
152
|
+
const labelTable = new import_apache_arrow.Table(columns);
|
|
153
|
+
return {
|
|
154
|
+
labelTable,
|
|
155
|
+
texts: sourceVectors.texts,
|
|
156
|
+
clipRects: sourceVectors.clipRects
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function resolveArrowTextBatchInputs(props, batchIndex) {
|
|
160
|
+
const { sourceVectors } = props;
|
|
161
|
+
const columns = {
|
|
162
|
+
positions: getArrowTextSourceBatch(sourceVectors.positions, "positions", batchIndex)
|
|
163
|
+
};
|
|
164
|
+
appendArrowTextBatchSourceColumn(columns, "colors", sourceVectors.colors, batchIndex);
|
|
165
|
+
appendArrowTextBatchSourceColumn(columns, "angles", sourceVectors.angles, batchIndex);
|
|
166
|
+
appendArrowTextBatchSourceColumn(columns, "sizes", sourceVectors.sizes, batchIndex);
|
|
167
|
+
appendArrowTextBatchSourceColumn(columns, "pixelOffsets", sourceVectors.pixelOffsets, batchIndex);
|
|
168
|
+
return {
|
|
169
|
+
labelTable: new import_apache_arrow.Table(columns),
|
|
170
|
+
texts: getArrowTextSourceBatch(sourceVectors.texts, "texts", batchIndex),
|
|
171
|
+
clipRects: sourceVectors.clipRects ? getArrowTextSourceBatch(sourceVectors.clipRects, "clipRects", batchIndex) : void 0
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function appendArrowTextBatchSourceColumn(columns, columnName, vector, batchIndex) {
|
|
175
|
+
if (!vector) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
columns[columnName] = getArrowTextSourceBatch(vector, columnName, batchIndex);
|
|
179
|
+
}
|
|
180
|
+
function getArrowTextSourceBatch(vector, vectorName, batchIndex) {
|
|
181
|
+
const data = vector.data[batchIndex];
|
|
182
|
+
if (!data) {
|
|
183
|
+
throw new Error(`Arrow text ${vectorName} source is missing batch ${batchIndex}`);
|
|
184
|
+
}
|
|
185
|
+
return new import_apache_arrow.Vector([data]);
|
|
186
|
+
}
|
|
187
|
+
function getArrowGPUVectorDataType(vector) {
|
|
188
|
+
return (0, import_arrow5.getRequiredArrowGPUVectorDataType)(vector);
|
|
189
|
+
}
|
|
190
|
+
function isArrowUtf8TextGPUVector(vector) {
|
|
191
|
+
const type = getArrowGPUVectorDataType(vector);
|
|
192
|
+
return type instanceof import_apache_arrow.Utf8 || (0, import_arrow_text.isArrowUtf8DictionaryType)(type);
|
|
193
|
+
}
|
|
194
|
+
function isArrowUtf8DictionaryGPUVector(vector) {
|
|
195
|
+
return (0, import_arrow_text.isArrowUtf8DictionaryType)(getArrowGPUVectorDataType(vector));
|
|
196
|
+
}
|
|
197
|
+
function assertArrowTextVectorTypes(props) {
|
|
198
|
+
var _a, _b;
|
|
199
|
+
const textType = getArrowGPUVectorDataType(props.texts);
|
|
200
|
+
const positionType = getArrowGPUVectorDataType(props.positions);
|
|
201
|
+
const colorType = props.colors ? getArrowGPUVectorDataType(props.colors) : void 0;
|
|
202
|
+
const angleType = props.angles ? getArrowGPUVectorDataType(props.angles) : void 0;
|
|
203
|
+
const sizeType = props.sizes ? getArrowGPUVectorDataType(props.sizes) : void 0;
|
|
204
|
+
const pixelOffsetType = props.pixelOffsets ? getArrowGPUVectorDataType(props.pixelOffsets) : void 0;
|
|
205
|
+
if (!isArrowUtf8TextGPUVector(props.texts)) {
|
|
206
|
+
throw new Error("ArrowTextModel texts must be GPUVector");
|
|
207
|
+
}
|
|
208
|
+
if (!(0, import_arrow_text.isArrowUtf8TextVector)(props.sourceVectors.texts)) {
|
|
209
|
+
throw new Error("ArrowTextModel sourceVectors.texts must be Utf8 or Dictionary<Utf8>");
|
|
210
|
+
}
|
|
211
|
+
if (!import_apache_arrow.util.compareTypes(props.sourceVectors.texts.type, textType)) {
|
|
212
|
+
throw new Error("ArrowTextModel sourceVectors.texts type must match GPU texts type");
|
|
213
|
+
}
|
|
214
|
+
if (!import_apache_arrow.DataType.isFixedSizeList(positionType) || positionType.listSize !== 2 || !(((_a = positionType.children[0]) == null ? void 0 : _a.type) instanceof import_apache_arrow.Float32)) {
|
|
215
|
+
throw new Error("ArrowTextModel positions must be GPUVector");
|
|
216
|
+
}
|
|
217
|
+
if (colorType && !isArrowTextColorType(colorType)) {
|
|
218
|
+
throw new Error("ArrowTextModel colors must be GPUVector or GPUVector<List<FixedSizeList<Uint8>[4]>>");
|
|
219
|
+
}
|
|
220
|
+
if (angleType && !(angleType instanceof import_apache_arrow.Float32)) {
|
|
221
|
+
throw new Error("ArrowTextModel angles must be GPUVector");
|
|
222
|
+
}
|
|
223
|
+
if (sizeType && !(sizeType instanceof import_apache_arrow.Float32)) {
|
|
224
|
+
throw new Error("ArrowTextModel sizes must be GPUVector");
|
|
225
|
+
}
|
|
226
|
+
if (pixelOffsetType && (!import_apache_arrow.DataType.isFixedSizeList(pixelOffsetType) || pixelOffsetType.listSize !== 2 || !(((_b = pixelOffsetType.children[0]) == null ? void 0 : _b.type) instanceof import_apache_arrow.Float32))) {
|
|
227
|
+
throw new Error("ArrowTextModel pixelOffsets must be GPUVector");
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function assertArrowTextVectorRowAlignment(props) {
|
|
231
|
+
const rowInputs = [
|
|
232
|
+
["positions", props.positions],
|
|
233
|
+
["texts", props.texts],
|
|
234
|
+
["colors", props.colors],
|
|
235
|
+
["angles", props.angles],
|
|
236
|
+
["sizes", props.sizes],
|
|
237
|
+
["pixelOffsets", props.pixelOffsets],
|
|
238
|
+
["clipRects", props.clipRects]
|
|
239
|
+
];
|
|
240
|
+
const suppliedInputs = rowInputs.filter(([, vector]) => vector !== void 0);
|
|
241
|
+
const [referenceName, referenceVector] = suppliedInputs[0];
|
|
242
|
+
for (const [name, vector] of suppliedInputs.slice(1)) {
|
|
243
|
+
if (vector.length !== referenceVector.length) {
|
|
244
|
+
throw new Error(`ArrowTextModel ${name} rows must match ${referenceName} rows (${vector.length} !== ${referenceVector.length})`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function assertArrowTextVectorBatchAlignment(props) {
|
|
249
|
+
assertArrowTextVectorRowAlignment(props);
|
|
250
|
+
const rowInputs = getArrowTextRowInputs(props);
|
|
251
|
+
const [referenceName, referenceVector] = rowInputs[0];
|
|
252
|
+
for (const [name, vector] of rowInputs.slice(1)) {
|
|
253
|
+
if (vector.data.length !== referenceVector.data.length) {
|
|
254
|
+
throw new Error(`ArrowTextModel ${name} batch count must match ${referenceName} batch count`);
|
|
255
|
+
}
|
|
256
|
+
for (let batchIndex = 0; batchIndex < vector.data.length; batchIndex++) {
|
|
257
|
+
if (vector.data[batchIndex].length !== referenceVector.data[batchIndex].length) {
|
|
258
|
+
throw new Error(`ArrowTextModel ${name} batch ${batchIndex} rows must match ${referenceName}`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function assertArrowTextSourceVectorAlignment(props) {
|
|
264
|
+
const sourceInputs = [
|
|
265
|
+
["positions", props.positions, props.sourceVectors.positions],
|
|
266
|
+
["texts", props.texts, props.sourceVectors.texts],
|
|
267
|
+
["colors", props.colors, props.sourceVectors.colors],
|
|
268
|
+
["angles", props.angles, props.sourceVectors.angles],
|
|
269
|
+
["sizes", props.sizes, props.sourceVectors.sizes],
|
|
270
|
+
["pixelOffsets", props.pixelOffsets, props.sourceVectors.pixelOffsets],
|
|
271
|
+
["clipRects", props.clipRects, props.sourceVectors.clipRects]
|
|
272
|
+
];
|
|
273
|
+
for (const [name, gpuVector, sourceVector] of sourceInputs) {
|
|
274
|
+
if (gpuVector && !sourceVector) {
|
|
275
|
+
throw new Error(`ArrowTextModel ${name} GPU rows require matching sourceVectors rows`);
|
|
276
|
+
}
|
|
277
|
+
if (!gpuVector && sourceVector) {
|
|
278
|
+
throw new Error(`ArrowTextModel sourceVectors.${name} requires matching GPU rows`);
|
|
279
|
+
}
|
|
280
|
+
if (!gpuVector || !sourceVector) {
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
assertSourceVectorMatchesGPUVector("ArrowTextModel", name, gpuVector, sourceVector);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
function getArrowTextRowInputs(props) {
|
|
287
|
+
return [
|
|
288
|
+
["positions", props.positions],
|
|
289
|
+
["texts", props.texts],
|
|
290
|
+
["colors", props.colors],
|
|
291
|
+
["angles", props.angles],
|
|
292
|
+
["sizes", props.sizes],
|
|
293
|
+
["pixelOffsets", props.pixelOffsets],
|
|
294
|
+
["clipRects", props.clipRects]
|
|
295
|
+
].filter(([, vector]) => vector !== void 0);
|
|
296
|
+
}
|
|
297
|
+
function assertSourceVectorMatchesGPUVector(ownerName, vectorName, gpuVector, sourceVector) {
|
|
298
|
+
if (sourceVector.length !== gpuVector.length) {
|
|
299
|
+
throw new Error(`${ownerName} sourceVectors.${vectorName} rows must match GPU rows (${sourceVector.length} !== ${gpuVector.length})`);
|
|
300
|
+
}
|
|
301
|
+
if (sourceVector.data.length !== gpuVector.data.length) {
|
|
302
|
+
throw new Error(`${ownerName} sourceVectors.${vectorName} batch count must match GPU batches`);
|
|
303
|
+
}
|
|
304
|
+
for (let batchIndex = 0; batchIndex < sourceVector.data.length; batchIndex++) {
|
|
305
|
+
if (sourceVector.data[batchIndex].length !== gpuVector.data[batchIndex].length) {
|
|
306
|
+
throw new Error(`${ownerName} sourceVectors.${vectorName} batch ${batchIndex} rows must match GPU rows`);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function resolveArrowTextStorageInputs(props) {
|
|
311
|
+
var _a, _b, _c, _d, _e, _f;
|
|
312
|
+
if (!props.sourceVectors) {
|
|
313
|
+
throw new Error("ArrowTextStorageModel requires explicit sourceVectors for CPU glyph expansion");
|
|
314
|
+
}
|
|
315
|
+
assertStorageVectorTypes(props);
|
|
316
|
+
assertTextStorageVectorBatchAlignment(props);
|
|
317
|
+
assertStorageSourceVectorAlignment(props);
|
|
318
|
+
const { sourceVectors } = props;
|
|
319
|
+
const batches = [];
|
|
320
|
+
let batchRowIndexBase = props.rowIndexBase ?? 0;
|
|
321
|
+
for (let batchIndex = 0; batchIndex < props.texts.data.length; batchIndex++) {
|
|
322
|
+
const textData = props.texts.data[batchIndex];
|
|
323
|
+
const positionsData = props.positions.data[batchIndex];
|
|
324
|
+
batches.push({
|
|
325
|
+
batchRowIndexBase,
|
|
326
|
+
rowStorageIndexBase: getGpuDataRowStorageIndexBase(positionsData, "positions", batchIndex),
|
|
327
|
+
texts: getArrowTextSourceBatch(sourceVectors.texts, "texts", batchIndex),
|
|
328
|
+
clipRects: sourceVectors.clipRects ? getArrowTextSourceBatch(sourceVectors.clipRects, "clipRects", batchIndex) : void 0,
|
|
329
|
+
positionsBuffer: positionsData.buffer,
|
|
330
|
+
colorsBuffer: (_a = props.colors) == null ? void 0 : _a.data[batchIndex].buffer,
|
|
331
|
+
anglesBuffer: (_b = props.angles) == null ? void 0 : _b.data[batchIndex].buffer,
|
|
332
|
+
sizesBuffer: (_c = props.sizes) == null ? void 0 : _c.data[batchIndex].buffer,
|
|
333
|
+
pixelOffsetsBuffer: (_d = props.pixelOffsets) == null ? void 0 : _d.data[batchIndex].buffer,
|
|
334
|
+
textAnchorsBuffer: (_e = props.textAnchors) == null ? void 0 : _e.data[batchIndex].buffer,
|
|
335
|
+
alignmentBaselinesBuffer: (_f = props.alignmentBaselines) == null ? void 0 : _f.data[batchIndex].buffer
|
|
336
|
+
});
|
|
337
|
+
batchRowIndexBase += textData.length;
|
|
338
|
+
}
|
|
339
|
+
return { texts: sourceVectors.texts, batches };
|
|
340
|
+
}
|
|
341
|
+
function resolveArrowTextDictionaryStorageInputs(props) {
|
|
342
|
+
var _a, _b, _c, _d, _e, _f;
|
|
343
|
+
if (!props.sourceVectors) {
|
|
344
|
+
throw new Error("ArrowTextDictionaryStorageModel requires explicit sourceVectors for compressed dictionary glyph layout");
|
|
345
|
+
}
|
|
346
|
+
assertTextDictionaryStorageVectorTypes(props);
|
|
347
|
+
assertTextStorageVectorBatchAlignment(props, "ArrowTextDictionaryStorageModel");
|
|
348
|
+
assertTextDictionaryStorageSourceVectorAlignment(props);
|
|
349
|
+
const { sourceVectors } = props;
|
|
350
|
+
const batches = [];
|
|
351
|
+
let batchRowIndexBase = props.rowIndexBase ?? 0;
|
|
352
|
+
for (let batchIndex = 0; batchIndex < props.texts.data.length; batchIndex++) {
|
|
353
|
+
const textData = props.texts.data[batchIndex];
|
|
354
|
+
const positionsData = props.positions.data[batchIndex];
|
|
355
|
+
batches.push({
|
|
356
|
+
batchRowIndexBase,
|
|
357
|
+
rowStorageIndexBase: getGpuDataRowStorageIndexBase(positionsData, "positions", batchIndex),
|
|
358
|
+
texts: getArrowTextSourceBatch(sourceVectors.texts, "texts", batchIndex),
|
|
359
|
+
clipRects: sourceVectors.clipRects ? getArrowTextSourceBatch(sourceVectors.clipRects, "clipRects", batchIndex) : void 0,
|
|
360
|
+
positionsBuffer: positionsData.buffer,
|
|
361
|
+
colorsBuffer: (_a = props.colors) == null ? void 0 : _a.data[batchIndex].buffer,
|
|
362
|
+
anglesBuffer: (_b = props.angles) == null ? void 0 : _b.data[batchIndex].buffer,
|
|
363
|
+
sizesBuffer: (_c = props.sizes) == null ? void 0 : _c.data[batchIndex].buffer,
|
|
364
|
+
pixelOffsetsBuffer: (_d = props.pixelOffsets) == null ? void 0 : _d.data[batchIndex].buffer,
|
|
365
|
+
textAnchorsBuffer: (_e = props.textAnchors) == null ? void 0 : _e.data[batchIndex].buffer,
|
|
366
|
+
alignmentBaselinesBuffer: (_f = props.alignmentBaselines) == null ? void 0 : _f.data[batchIndex].buffer
|
|
367
|
+
});
|
|
368
|
+
batchRowIndexBase += textData.length;
|
|
369
|
+
}
|
|
370
|
+
return { texts: sourceVectors.texts, batches };
|
|
371
|
+
}
|
|
372
|
+
function resolveGPUVectorTextStorageInputs(device, props) {
|
|
373
|
+
var _a, _b, _c, _d, _e, _f;
|
|
374
|
+
assertGPUVectorTextStorageInputTypes(props);
|
|
375
|
+
assertTextStorageVectorBatchAlignment(props, "TextStorageModel");
|
|
376
|
+
const preparedTextBatches = props.textBatches ?? createGPUVectorTextStorageBatchesFromTexts(device, props);
|
|
377
|
+
if (preparedTextBatches.length !== props.texts.data.length) {
|
|
378
|
+
throw new Error("TextStorageModel textBatches must match texts GPUVector batch count");
|
|
379
|
+
}
|
|
380
|
+
const batches = [];
|
|
381
|
+
let batchRowIndexBase = props.rowIndexBase ?? 0;
|
|
382
|
+
for (let batchIndex = 0; batchIndex < props.texts.data.length; batchIndex++) {
|
|
383
|
+
const textData = props.texts.data[batchIndex];
|
|
384
|
+
const positionsData = props.positions.data[batchIndex];
|
|
385
|
+
const textBatch = preparedTextBatches[batchIndex];
|
|
386
|
+
if (!textBatch) {
|
|
387
|
+
throw new Error(`TextStorageModel textBatches is missing batch ${batchIndex}`);
|
|
388
|
+
}
|
|
389
|
+
if (textBatch.rowCount !== textData.length) {
|
|
390
|
+
throw new Error("TextStorageModel textBatches rows must match texts GPU rows");
|
|
391
|
+
}
|
|
392
|
+
batches.push({
|
|
393
|
+
...textBatch,
|
|
394
|
+
batchRowIndexBase,
|
|
395
|
+
rowStorageIndexBase: getGpuDataRowStorageIndexBase(positionsData, "positions", batchIndex),
|
|
396
|
+
positionsBuffer: positionsData.buffer,
|
|
397
|
+
colorsBuffer: (_a = props.colors) == null ? void 0 : _a.data[batchIndex].buffer,
|
|
398
|
+
anglesBuffer: (_b = props.angles) == null ? void 0 : _b.data[batchIndex].buffer,
|
|
399
|
+
sizesBuffer: (_c = props.sizes) == null ? void 0 : _c.data[batchIndex].buffer,
|
|
400
|
+
pixelOffsetsBuffer: (_d = props.pixelOffsets) == null ? void 0 : _d.data[batchIndex].buffer,
|
|
401
|
+
textAnchorsBuffer: (_e = props.textAnchors) == null ? void 0 : _e.data[batchIndex].buffer,
|
|
402
|
+
alignmentBaselinesBuffer: (_f = props.alignmentBaselines) == null ? void 0 : _f.data[batchIndex].buffer,
|
|
403
|
+
clipRectsBuffer: props.clipRects ? getGPUVectorTextStorageClipRectsBuffer(props.clipRects, batchIndex) : void 0
|
|
404
|
+
});
|
|
405
|
+
batchRowIndexBase += textData.length;
|
|
406
|
+
}
|
|
407
|
+
return { batches };
|
|
408
|
+
}
|
|
409
|
+
function assertStorageVectorTypes(props) {
|
|
410
|
+
var _a, _b, _c;
|
|
411
|
+
const textType = getArrowGPUVectorDataType(props.texts);
|
|
412
|
+
const positionType = getArrowGPUVectorDataType(props.positions);
|
|
413
|
+
const colorType = props.colors ? getArrowGPUVectorDataType(props.colors) : void 0;
|
|
414
|
+
const angleType = props.angles ? getArrowGPUVectorDataType(props.angles) : void 0;
|
|
415
|
+
const sizeType = props.sizes ? getArrowGPUVectorDataType(props.sizes) : void 0;
|
|
416
|
+
const pixelOffsetType = props.pixelOffsets ? getArrowGPUVectorDataType(props.pixelOffsets) : void 0;
|
|
417
|
+
const textAnchorType = props.textAnchors ? getArrowGPUVectorDataType(props.textAnchors) : void 0;
|
|
418
|
+
const alignmentBaselineType = props.alignmentBaselines ? getArrowGPUVectorDataType(props.alignmentBaselines) : void 0;
|
|
419
|
+
if (!isArrowUtf8TextGPUVector(props.texts)) {
|
|
420
|
+
throw new Error("ArrowTextStorageModel texts must be GPUVector");
|
|
421
|
+
}
|
|
422
|
+
if (!(0, import_arrow_text.isArrowUtf8TextVector)(props.sourceVectors.texts)) {
|
|
423
|
+
throw new Error("ArrowTextStorageModel sourceVectors.texts must be Utf8 or Dictionary<Utf8>");
|
|
424
|
+
}
|
|
425
|
+
if (!import_apache_arrow.util.compareTypes(props.sourceVectors.texts.type, textType)) {
|
|
426
|
+
throw new Error("ArrowTextStorageModel sourceVectors.texts type must match GPU texts type");
|
|
427
|
+
}
|
|
428
|
+
if (!import_apache_arrow.DataType.isFixedSizeList(positionType) || positionType.listSize !== 2 || !(((_a = positionType.children[0]) == null ? void 0 : _a.type) instanceof import_apache_arrow.Float32)) {
|
|
429
|
+
throw new Error("ArrowTextStorageModel positions must be GPUVector");
|
|
430
|
+
}
|
|
431
|
+
if (colorType && (!import_apache_arrow.DataType.isFixedSizeList(colorType) || colorType.listSize !== 4 || !(((_b = colorType.children[0]) == null ? void 0 : _b.type) instanceof import_apache_arrow.Uint8))) {
|
|
432
|
+
throw new Error("ArrowTextStorageModel colors must be GPUVector");
|
|
433
|
+
}
|
|
434
|
+
if (angleType && !(angleType instanceof import_apache_arrow.Float32)) {
|
|
435
|
+
throw new Error("ArrowTextStorageModel angles must be GPUVector");
|
|
436
|
+
}
|
|
437
|
+
if (sizeType && !(sizeType instanceof import_apache_arrow.Float32)) {
|
|
438
|
+
throw new Error("ArrowTextStorageModel sizes must be GPUVector");
|
|
439
|
+
}
|
|
440
|
+
if (pixelOffsetType && (!import_apache_arrow.DataType.isFixedSizeList(pixelOffsetType) || pixelOffsetType.listSize !== 2 || !(((_c = pixelOffsetType.children[0]) == null ? void 0 : _c.type) instanceof import_apache_arrow.Float32))) {
|
|
441
|
+
throw new Error("ArrowTextStorageModel pixelOffsets must be GPUVector");
|
|
442
|
+
}
|
|
443
|
+
if (textAnchorType && !(textAnchorType instanceof import_apache_arrow.Uint8)) {
|
|
444
|
+
throw new Error("ArrowTextStorageModel textAnchors must be GPUVector");
|
|
445
|
+
}
|
|
446
|
+
if (alignmentBaselineType && !(alignmentBaselineType instanceof import_apache_arrow.Uint8)) {
|
|
447
|
+
throw new Error("ArrowTextStorageModel alignmentBaselines must be GPUVector");
|
|
448
|
+
}
|
|
449
|
+
const clipRects = props.sourceVectors.clipRects;
|
|
450
|
+
assertClipRects(clipRects, props.texts.length);
|
|
451
|
+
}
|
|
452
|
+
function assertGPUVectorTextStorageInputTypes(props) {
|
|
453
|
+
(0, import_text_experimental.assertTextStorageGPUVectorInputs)(props);
|
|
454
|
+
}
|
|
455
|
+
function createGPUVectorTextStorageBatchesFromTexts(device, props) {
|
|
456
|
+
return props.texts.data.map((data, batchIndex) => {
|
|
457
|
+
if (data.byteOffset !== 0 || data.byteStride !== 1) {
|
|
458
|
+
throw new Error("TextStorageModel GPUVector UTF-8 batches must be zero-offset byte buffers");
|
|
459
|
+
}
|
|
460
|
+
const { valueOffsets, nullBitmap, valueByteLength } = data;
|
|
461
|
+
if (!valueOffsets || valueByteLength === void 0) {
|
|
462
|
+
throw new Error("TextStorageModel GPUVector UTF-8 batches require row offset metadata");
|
|
463
|
+
}
|
|
464
|
+
const rowByteRanges = new Uint32Array(data.length * 2);
|
|
465
|
+
const startIndices = new Array(data.length + 1);
|
|
466
|
+
startIndices[0] = 0;
|
|
467
|
+
for (let rowIndex = 0; rowIndex < data.length; rowIndex++) {
|
|
468
|
+
const isValid = isGPUVectorTextStorageRowValid(nullBitmap, rowIndex);
|
|
469
|
+
const startIndex = isValid ? valueOffsets[rowIndex] ?? 0 : 0;
|
|
470
|
+
const endIndex = isValid ? valueOffsets[rowIndex + 1] ?? startIndex : startIndex;
|
|
471
|
+
rowByteRanges[rowIndex * 2] = startIndex;
|
|
472
|
+
rowByteRanges[rowIndex * 2 + 1] = endIndex;
|
|
473
|
+
startIndices[rowIndex + 1] = Math.max(startIndices[rowIndex] ?? 0, endIndex);
|
|
474
|
+
}
|
|
475
|
+
const rowByteRangesBuffer = device.createBuffer({
|
|
476
|
+
id: `${props.id || "text-storage-model"}-utf8-row-byte-ranges-${batchIndex}`,
|
|
477
|
+
usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC,
|
|
478
|
+
data: rowByteRanges.byteLength > 0 ? rowByteRanges : new Uint32Array(2)
|
|
479
|
+
});
|
|
480
|
+
return {
|
|
481
|
+
rowCount: data.length,
|
|
482
|
+
startIndices,
|
|
483
|
+
rowByteRanges,
|
|
484
|
+
rowByteRangesBuffer,
|
|
485
|
+
utf8BytesBuffer: data.buffer,
|
|
486
|
+
byteLength: valueByteLength,
|
|
487
|
+
inputByteLength: rowByteRanges.byteLength + valueByteLength,
|
|
488
|
+
ownsRowByteRangesBuffer: true
|
|
489
|
+
};
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
function isGPUVectorTextStorageRowValid(nullBitmap, rowIndex) {
|
|
493
|
+
if (!nullBitmap) {
|
|
494
|
+
return true;
|
|
495
|
+
}
|
|
496
|
+
return (nullBitmap[rowIndex >> 3] & 1 << (rowIndex & 7)) !== 0;
|
|
497
|
+
}
|
|
498
|
+
function getGPUVectorTextStorageClipRectsBuffer(clipRects, batchIndex) {
|
|
499
|
+
const clipRectsData = clipRects.data[batchIndex];
|
|
500
|
+
if (!clipRectsData) {
|
|
501
|
+
throw new Error(`TextStorageModel clipRects is missing batch ${batchIndex}`);
|
|
502
|
+
}
|
|
503
|
+
if (clipRectsData.byteOffset !== 0 || clipRectsData.byteStride !== Float32Array.BYTES_PER_ELEMENT * 4) {
|
|
504
|
+
throw new Error("TextStorageModel GPUVector clipRects batches must be zero-offset packed Float32x4 buffers");
|
|
505
|
+
}
|
|
506
|
+
return clipRectsData.buffer;
|
|
507
|
+
}
|
|
508
|
+
function assertTextStorageVectorBatchAlignment(props, ownerName = "ArrowTextStorageModel") {
|
|
509
|
+
const rowInputs = [
|
|
510
|
+
["positions", props.positions],
|
|
511
|
+
["texts", props.texts],
|
|
512
|
+
["colors", props.colors],
|
|
513
|
+
["angles", props.angles],
|
|
514
|
+
["sizes", props.sizes],
|
|
515
|
+
["pixelOffsets", props.pixelOffsets],
|
|
516
|
+
["textAnchors", props.textAnchors],
|
|
517
|
+
["alignmentBaselines", props.alignmentBaselines],
|
|
518
|
+
["clipRects", props.clipRects]
|
|
519
|
+
];
|
|
520
|
+
const suppliedInputs = rowInputs.filter(([, vector]) => vector !== void 0);
|
|
521
|
+
const [referenceName, referenceVector] = suppliedInputs[0];
|
|
522
|
+
for (const [name, vector] of suppliedInputs.slice(1)) {
|
|
523
|
+
if (vector.length !== referenceVector.length) {
|
|
524
|
+
throw new Error(`${ownerName} ${name} rows must match ${referenceName} rows (${vector.length} !== ${referenceVector.length})`);
|
|
525
|
+
}
|
|
526
|
+
if (vector.data.length !== referenceVector.data.length) {
|
|
527
|
+
throw new Error(`${ownerName} ${name} batch count must match ${referenceName} batch count`);
|
|
528
|
+
}
|
|
529
|
+
for (let batchIndex = 0; batchIndex < vector.data.length; batchIndex++) {
|
|
530
|
+
if (vector.data[batchIndex].length !== referenceVector.data[batchIndex].length) {
|
|
531
|
+
throw new Error(`${ownerName} ${name} batch ${batchIndex} rows must match ${referenceName}`);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
function assertStorageSourceVectorAlignment(props) {
|
|
537
|
+
assertSourceVectorMatchesGPUVector("ArrowTextStorageModel", "texts", props.texts, props.sourceVectors.texts);
|
|
538
|
+
if (props.clipRects && !props.sourceVectors.clipRects) {
|
|
539
|
+
throw new Error("ArrowTextStorageModel clipRects GPU rows require matching sourceVectors rows");
|
|
540
|
+
}
|
|
541
|
+
if (!props.clipRects && props.sourceVectors.clipRects) {
|
|
542
|
+
throw new Error("ArrowTextStorageModel sourceVectors.clipRects requires matching GPU clipRects rows");
|
|
543
|
+
}
|
|
544
|
+
if (props.clipRects && props.sourceVectors.clipRects) {
|
|
545
|
+
assertSourceVectorMatchesGPUVector("ArrowTextStorageModel", "clipRects", props.clipRects, props.sourceVectors.clipRects);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
function assertTextDictionaryStorageVectorTypes(props) {
|
|
549
|
+
var _a, _b, _c;
|
|
550
|
+
const textType = getArrowGPUVectorDataType(props.texts);
|
|
551
|
+
const positionType = getArrowGPUVectorDataType(props.positions);
|
|
552
|
+
const colorType = props.colors ? getArrowGPUVectorDataType(props.colors) : void 0;
|
|
553
|
+
const angleType = props.angles ? getArrowGPUVectorDataType(props.angles) : void 0;
|
|
554
|
+
const sizeType = props.sizes ? getArrowGPUVectorDataType(props.sizes) : void 0;
|
|
555
|
+
const pixelOffsetType = props.pixelOffsets ? getArrowGPUVectorDataType(props.pixelOffsets) : void 0;
|
|
556
|
+
const textAnchorType = props.textAnchors ? getArrowGPUVectorDataType(props.textAnchors) : void 0;
|
|
557
|
+
const alignmentBaselineType = props.alignmentBaselines ? getArrowGPUVectorDataType(props.alignmentBaselines) : void 0;
|
|
558
|
+
if (!isArrowUtf8DictionaryGPUVector(props.texts)) {
|
|
559
|
+
throw new Error("ArrowTextDictionaryStorageModel texts must be GPUVector");
|
|
560
|
+
}
|
|
561
|
+
if (!(0, import_arrow_text.isArrowUtf8DictionaryVector)(props.sourceVectors.texts)) {
|
|
562
|
+
throw new Error("ArrowTextDictionaryStorageModel sourceVectors.texts must be Dictionary<Utf8>");
|
|
563
|
+
}
|
|
564
|
+
if (!import_apache_arrow.util.compareTypes(props.sourceVectors.texts.type, textType)) {
|
|
565
|
+
throw new Error("ArrowTextDictionaryStorageModel sourceVectors.texts type must match GPU texts type");
|
|
566
|
+
}
|
|
567
|
+
if (!import_apache_arrow.DataType.isFixedSizeList(positionType) || positionType.listSize !== 2 || !(((_a = positionType.children[0]) == null ? void 0 : _a.type) instanceof import_apache_arrow.Float32)) {
|
|
568
|
+
throw new Error("ArrowTextDictionaryStorageModel positions must be GPUVector");
|
|
569
|
+
}
|
|
570
|
+
if (colorType && (!import_apache_arrow.DataType.isFixedSizeList(colorType) || colorType.listSize !== 4 || !(((_b = colorType.children[0]) == null ? void 0 : _b.type) instanceof import_apache_arrow.Uint8))) {
|
|
571
|
+
throw new Error("ArrowTextDictionaryStorageModel colors must be GPUVector");
|
|
572
|
+
}
|
|
573
|
+
if (angleType && !(angleType instanceof import_apache_arrow.Float32)) {
|
|
574
|
+
throw new Error("ArrowTextDictionaryStorageModel angles must be GPUVector");
|
|
575
|
+
}
|
|
576
|
+
if (sizeType && !(sizeType instanceof import_apache_arrow.Float32)) {
|
|
577
|
+
throw new Error("ArrowTextDictionaryStorageModel sizes must be GPUVector");
|
|
578
|
+
}
|
|
579
|
+
if (pixelOffsetType && (!import_apache_arrow.DataType.isFixedSizeList(pixelOffsetType) || pixelOffsetType.listSize !== 2 || !(((_c = pixelOffsetType.children[0]) == null ? void 0 : _c.type) instanceof import_apache_arrow.Float32))) {
|
|
580
|
+
throw new Error("ArrowTextDictionaryStorageModel pixelOffsets must be GPUVector");
|
|
581
|
+
}
|
|
582
|
+
if (textAnchorType && !(textAnchorType instanceof import_apache_arrow.Uint8)) {
|
|
583
|
+
throw new Error("ArrowTextDictionaryStorageModel textAnchors must be GPUVector");
|
|
584
|
+
}
|
|
585
|
+
if (alignmentBaselineType && !(alignmentBaselineType instanceof import_apache_arrow.Uint8)) {
|
|
586
|
+
throw new Error("ArrowTextDictionaryStorageModel alignmentBaselines must be GPUVector");
|
|
587
|
+
}
|
|
588
|
+
const clipRects = props.sourceVectors.clipRects;
|
|
589
|
+
assertClipRects(clipRects, props.texts.length);
|
|
590
|
+
}
|
|
591
|
+
function assertTextDictionaryStorageSourceVectorAlignment(props) {
|
|
592
|
+
assertSourceVectorMatchesGPUVector("ArrowTextDictionaryStorageModel", "texts", props.texts, props.sourceVectors.texts);
|
|
593
|
+
if (props.clipRects && !props.sourceVectors.clipRects) {
|
|
594
|
+
throw new Error("ArrowTextDictionaryStorageModel clipRects GPU rows require matching sourceVectors rows");
|
|
595
|
+
}
|
|
596
|
+
if (!props.clipRects && props.sourceVectors.clipRects) {
|
|
597
|
+
throw new Error("ArrowTextDictionaryStorageModel sourceVectors.clipRects requires matching GPU clipRects rows");
|
|
598
|
+
}
|
|
599
|
+
if (props.clipRects && props.sourceVectors.clipRects) {
|
|
600
|
+
assertSourceVectorMatchesGPUVector("ArrowTextDictionaryStorageModel", "clipRects", props.clipRects, props.sourceVectors.clipRects);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
function getGpuDataRowStorageIndexBase(data, vectorName, batchIndex) {
|
|
604
|
+
if (!Number.isFinite(data.byteStride) || data.byteStride <= 0) {
|
|
605
|
+
throw new Error(`ArrowTextStorageModel ${vectorName} batch ${batchIndex} has invalid byte stride`);
|
|
606
|
+
}
|
|
607
|
+
const rowStorageIndexBase = data.byteOffset / data.byteStride;
|
|
608
|
+
if (!Number.isInteger(rowStorageIndexBase)) {
|
|
609
|
+
throw new Error(`ArrowTextStorageModel ${vectorName} batch ${batchIndex} byte offset is not row aligned`);
|
|
610
|
+
}
|
|
611
|
+
return rowStorageIndexBase;
|
|
612
|
+
}
|
|
613
|
+
function createArrowTextAttributeState(device, props) {
|
|
614
|
+
return {
|
|
615
|
+
...makeArrowTextModelProps(device, props),
|
|
616
|
+
textProps: props
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
function makeArrowTextModelProps(device, props) {
|
|
620
|
+
const textInputs = resolveArrowTextInputs(props);
|
|
621
|
+
const mappingState = resolveCharacterMapping(props);
|
|
622
|
+
const defaultFragmentShaderUniforms = (0, import_text_experimental.createTextDefaultFragmentShaderUniforms)(props.uniforms, mappingState.fontRenderSettings);
|
|
623
|
+
const glyphTable = buildArrowTextGlyphTable({
|
|
624
|
+
labelTable: textInputs.labelTable,
|
|
625
|
+
texts: textInputs.texts,
|
|
626
|
+
clipRects: textInputs.clipRects,
|
|
627
|
+
fontAtlas: mappingState.fontAtlas,
|
|
628
|
+
lineHeight: mappingState.lineHeight,
|
|
629
|
+
characterSet: mappingState.characterSet,
|
|
630
|
+
rowIndexBase: props.rowIndexBase,
|
|
631
|
+
color: props.color,
|
|
632
|
+
angle: props.angle,
|
|
633
|
+
size: props.size
|
|
634
|
+
});
|
|
635
|
+
const shaderLayout = resolveArrowTextShaderLayout(props);
|
|
636
|
+
const generatedBufferBatches = (0, import_gpu_tables.planGeneratedBufferBatches)({
|
|
637
|
+
device,
|
|
638
|
+
recordOffsets: glyphTable.glyphLayout.startIndices,
|
|
639
|
+
recordByteStride: textInputs.clipRects ? CLIPPED_EXPANDED_GLYPH_VERTEX_BYTE_STRIDE : EXPANDED_GLYPH_VERTEX_BYTE_STRIDE,
|
|
640
|
+
resourceLabel: "ArrowTextModel expanded glyph vertex data"
|
|
641
|
+
});
|
|
642
|
+
const expandedGlyphVertexStates = generatedBufferBatches.map((generatedBufferBatch) => createExpandedGlyphVertexData(device, props, {
|
|
643
|
+
glyphTable,
|
|
644
|
+
shaderLayout,
|
|
645
|
+
generatedBufferBatch,
|
|
646
|
+
rowIndexBase: 0
|
|
647
|
+
}));
|
|
648
|
+
const firstExpandedGlyphVertexState = expandedGlyphVertexStates[0];
|
|
649
|
+
if (!firstExpandedGlyphVertexState) {
|
|
650
|
+
throw new Error("ArrowTextModel requires at least one generated glyph render batch");
|
|
651
|
+
}
|
|
652
|
+
const renderBatches = generatedBufferBatches.map((generatedBufferBatch, batchIndex) => ({
|
|
653
|
+
rowStart: generatedBufferBatch.rowStart,
|
|
654
|
+
rowEnd: generatedBufferBatch.rowEnd,
|
|
655
|
+
glyphCount: generatedBufferBatch.recordCount,
|
|
656
|
+
expandedGlyphVertexData: expandedGlyphVertexStates[batchIndex].buffer
|
|
657
|
+
}));
|
|
658
|
+
const expandedGlyphVertexState = firstExpandedGlyphVertexState;
|
|
659
|
+
const { atlasTexture, ownsAtlasTexture } = getTextAtlasTexture(device, props, mappingState.fontAtlas);
|
|
660
|
+
const modelProps = {
|
|
661
|
+
...props,
|
|
662
|
+
vs: props.vs ?? (textInputs.clipRects ? import_text_experimental.DEFAULT_CLIPPED_TEXT_VS : import_text_experimental.DEFAULT_TEXT_VS),
|
|
663
|
+
fs: props.fs ?? import_text_experimental.DEFAULT_TEXT_FS,
|
|
664
|
+
uniforms: defaultFragmentShaderUniforms,
|
|
665
|
+
shaderLayout,
|
|
666
|
+
bindings: {
|
|
667
|
+
...props.bindings || {},
|
|
668
|
+
fontAtlasTexture: atlasTexture
|
|
669
|
+
},
|
|
670
|
+
attributes: {
|
|
671
|
+
...props.attributes || {},
|
|
672
|
+
[EXPANDED_GLYPH_VERTEX_DATA]: expandedGlyphVertexState.buffer
|
|
673
|
+
},
|
|
674
|
+
bufferLayout: [...props.bufferLayout || [], expandedGlyphVertexState.bufferLayout],
|
|
675
|
+
vertexCount: props.vertexCount ?? 6,
|
|
676
|
+
instanceCount: glyphTable.glyphLayout.glyphCount,
|
|
677
|
+
table: (0, import_arrow3.makeGPUTableFromArrowTable)(device, createArrowTextRenderTable(glyphTable.table, generatedBufferBatches), { shaderLayout }),
|
|
678
|
+
tableCount: "none"
|
|
679
|
+
};
|
|
680
|
+
let destroyed = false;
|
|
681
|
+
return {
|
|
682
|
+
modelProps,
|
|
683
|
+
glyphLayout: glyphTable.glyphLayout,
|
|
684
|
+
glyphTable,
|
|
685
|
+
expandedGlyphVertexData: expandedGlyphVertexState.buffer,
|
|
686
|
+
renderBatches,
|
|
687
|
+
atlasTexture,
|
|
688
|
+
glyphAttributeBuildTimeMs: glyphTable.glyphAttributeBuildTimeMs,
|
|
689
|
+
glyphAttributeByteLength: glyphTable.attributeByteLength,
|
|
690
|
+
fontRenderSettings: mappingState.fontRenderSettings,
|
|
691
|
+
defaultFragmentShaderUniforms,
|
|
692
|
+
mappingState,
|
|
693
|
+
destroy: () => {
|
|
694
|
+
var _a;
|
|
695
|
+
if (destroyed) {
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
destroyed = true;
|
|
699
|
+
if (ownsAtlasTexture) {
|
|
700
|
+
atlasTexture.destroy();
|
|
701
|
+
}
|
|
702
|
+
for (const renderBatch of renderBatches) {
|
|
703
|
+
renderBatch.expandedGlyphVertexData.destroy();
|
|
704
|
+
}
|
|
705
|
+
(_a = modelProps.table) == null ? void 0 : _a.destroy();
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
function resolveArrowTextShaderLayout(props) {
|
|
710
|
+
return props.shaderLayout ?? (props.clipRects ? import_text_experimental.DEFAULT_CLIPPED_TEXT_SHADER_LAYOUT : import_text_experimental.DEFAULT_TEXT_SHADER_LAYOUT);
|
|
711
|
+
}
|
|
712
|
+
function createArrowTextRenderTable(glyphTable, generatedBufferBatches) {
|
|
713
|
+
const generatedGlyphColumnNames = /* @__PURE__ */ new Set([
|
|
714
|
+
GLYPH_OFFSETS_COLUMN,
|
|
715
|
+
GLYPH_FRAMES_COLUMN,
|
|
716
|
+
GLYPH_PAGES_COLUMN,
|
|
717
|
+
GLYPH_CLIP_RECTS_COLUMN,
|
|
718
|
+
ROW_INDICES_COLUMN
|
|
719
|
+
]);
|
|
720
|
+
const fields = [];
|
|
721
|
+
const columns = {};
|
|
722
|
+
for (const field of glyphTable.schema.fields) {
|
|
723
|
+
if (generatedGlyphColumnNames.has(field.name)) {
|
|
724
|
+
continue;
|
|
725
|
+
}
|
|
726
|
+
const vector = glyphTable.getChild(field.name);
|
|
727
|
+
if (!vector) {
|
|
728
|
+
continue;
|
|
729
|
+
}
|
|
730
|
+
fields.push(field);
|
|
731
|
+
columns[field.name] = vector;
|
|
732
|
+
}
|
|
733
|
+
const renderTable = new import_apache_arrow.Table(new import_apache_arrow.Schema(fields, new Map(glyphTable.schema.metadata)), columns);
|
|
734
|
+
if (!generatedBufferBatches || generatedBufferBatches.length <= 1) {
|
|
735
|
+
return renderTable;
|
|
736
|
+
}
|
|
737
|
+
const recordBatches = generatedBufferBatches.flatMap((batch) => renderTable.slice(batch.recordStart, batch.recordEnd).batches);
|
|
738
|
+
return new import_apache_arrow.Table(renderTable.schema, recordBatches);
|
|
739
|
+
}
|
|
740
|
+
function createExpandedGlyphVertexData(device, props, { glyphTable, shaderLayout, generatedBufferBatch, rowIndexBase = 0 }) {
|
|
741
|
+
const { glyphLayout } = glyphTable;
|
|
742
|
+
const glyphClipRects = glyphTable.table.getChild(GLYPH_CLIP_RECTS_COLUMN);
|
|
743
|
+
const glyphClipRectValues = glyphClipRects ? (0, import_arrow2.getArrowVectorBufferSource)(glyphClipRects) : void 0;
|
|
744
|
+
const byteStride = glyphClipRectValues ? CLIPPED_EXPANDED_GLYPH_VERTEX_BYTE_STRIDE : EXPANDED_GLYPH_VERTEX_BYTE_STRIDE;
|
|
745
|
+
const byteLength = generatedBufferBatch.byteLength;
|
|
746
|
+
const arrayBuffer = new ArrayBuffer(Math.max(byteLength, byteStride));
|
|
747
|
+
const int16Values = new Int16Array(arrayBuffer);
|
|
748
|
+
const uint16Values = new Uint16Array(arrayBuffer);
|
|
749
|
+
const uint32Values = new Uint32Array(arrayBuffer);
|
|
750
|
+
const float32Values = new Float32Array(arrayBuffer);
|
|
751
|
+
const rowIndices = makeGlyphRowIndices(glyphLayout.startIndices, rowIndexBase);
|
|
752
|
+
for (let glyphIndex = generatedBufferBatch.recordStart; glyphIndex < generatedBufferBatch.recordEnd; glyphIndex++) {
|
|
753
|
+
const batchGlyphIndex = glyphIndex - generatedBufferBatch.recordStart;
|
|
754
|
+
const recordInt16Index = batchGlyphIndex * byteStride / Int16Array.BYTES_PER_ELEMENT;
|
|
755
|
+
const recordUint32Index = batchGlyphIndex * byteStride / Uint32Array.BYTES_PER_ELEMENT;
|
|
756
|
+
const recordFloat32Index = batchGlyphIndex * byteStride / Float32Array.BYTES_PER_ELEMENT;
|
|
757
|
+
const glyphOffsetIndex = glyphIndex * 2;
|
|
758
|
+
const glyphFrameIndex = glyphIndex * 4;
|
|
759
|
+
int16Values[recordInt16Index] = glyphLayout.glyphOffsets[glyphOffsetIndex];
|
|
760
|
+
int16Values[recordInt16Index + 1] = glyphLayout.glyphOffsets[glyphOffsetIndex + 1];
|
|
761
|
+
uint16Values[recordInt16Index + 2] = glyphLayout.glyphFrames[glyphFrameIndex];
|
|
762
|
+
uint16Values[recordInt16Index + 3] = glyphLayout.glyphFrames[glyphFrameIndex + 1];
|
|
763
|
+
uint16Values[recordInt16Index + 4] = glyphLayout.glyphFrames[glyphFrameIndex + 2];
|
|
764
|
+
uint16Values[recordInt16Index + 5] = glyphLayout.glyphFrames[glyphFrameIndex + 3];
|
|
765
|
+
uint16Values[recordInt16Index + 6] = glyphLayout.glyphPages[glyphIndex];
|
|
766
|
+
uint32Values[recordUint32Index + 4] = rowIndices[glyphIndex];
|
|
767
|
+
if (glyphClipRectValues) {
|
|
768
|
+
const glyphClipRectIndex = glyphIndex * 4;
|
|
769
|
+
float32Values[recordFloat32Index + 5] = glyphClipRectValues[glyphClipRectIndex];
|
|
770
|
+
float32Values[recordFloat32Index + 6] = glyphClipRectValues[glyphClipRectIndex + 1];
|
|
771
|
+
float32Values[recordFloat32Index + 7] = glyphClipRectValues[glyphClipRectIndex + 2];
|
|
772
|
+
float32Values[recordFloat32Index + 8] = glyphClipRectValues[glyphClipRectIndex + 3];
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
const shaderAttributeNames = new Set(shaderLayout.attributes.map((attribute) => attribute.name));
|
|
776
|
+
const attributes = [];
|
|
777
|
+
if (shaderAttributeNames.has(GLYPH_OFFSETS_COLUMN)) {
|
|
778
|
+
attributes.push({ attribute: GLYPH_OFFSETS_COLUMN, format: "sint16x2", byteOffset: 0 });
|
|
779
|
+
}
|
|
780
|
+
if (shaderAttributeNames.has(GLYPH_FRAMES_COLUMN)) {
|
|
781
|
+
attributes.push({
|
|
782
|
+
attribute: GLYPH_FRAMES_COLUMN,
|
|
783
|
+
format: "uint16x4",
|
|
784
|
+
byteOffset: Int16Array.BYTES_PER_ELEMENT * 2
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
if (shaderAttributeNames.has(GLYPH_PAGES_COLUMN)) {
|
|
788
|
+
attributes.push({
|
|
789
|
+
attribute: GLYPH_PAGES_COLUMN,
|
|
790
|
+
format: "uint16",
|
|
791
|
+
byteOffset: Int16Array.BYTES_PER_ELEMENT * 6
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
if (shaderAttributeNames.has(ROW_INDICES_COLUMN)) {
|
|
795
|
+
attributes.push({
|
|
796
|
+
attribute: ROW_INDICES_COLUMN,
|
|
797
|
+
format: "uint32",
|
|
798
|
+
byteOffset: Int16Array.BYTES_PER_ELEMENT * 8
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
if (glyphClipRectValues && shaderAttributeNames.has(GLYPH_CLIP_RECTS_COLUMN)) {
|
|
802
|
+
attributes.push({
|
|
803
|
+
attribute: GLYPH_CLIP_RECTS_COLUMN,
|
|
804
|
+
format: "float32x4",
|
|
805
|
+
byteOffset: EXPANDED_GLYPH_VERTEX_BYTE_STRIDE
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
return {
|
|
809
|
+
buffer: device.createBuffer({
|
|
810
|
+
id: `${props.id || "arrow-text-model"}-expanded-glyph-vertex-data-${generatedBufferBatch.rowStart}`,
|
|
811
|
+
usage: import_core.Buffer.VERTEX | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC,
|
|
812
|
+
data: new Uint8Array(arrayBuffer)
|
|
813
|
+
}),
|
|
814
|
+
bufferLayout: {
|
|
815
|
+
name: EXPANDED_GLYPH_VERTEX_DATA,
|
|
816
|
+
stepMode: "instance",
|
|
817
|
+
byteStride,
|
|
818
|
+
attributes
|
|
819
|
+
},
|
|
820
|
+
byteLength
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
function createArrowTextStorageState(device, props) {
|
|
824
|
+
if (device.type !== "webgpu") {
|
|
825
|
+
throw new Error("createArrowTextStorageState requires a WebGPU device");
|
|
826
|
+
}
|
|
827
|
+
if (!(0, import_text_experimental.supportsGpuTextExpansion)(device)) {
|
|
828
|
+
throw new Error(`createArrowTextStorageState requires at least ${import_text_experimental.GPU_TEXT_EXPANSION_STORAGE_BUFFER_COUNT} storage buffer bindings per shader stage`);
|
|
829
|
+
}
|
|
830
|
+
const textInputs = resolveArrowTextStorageInputs(props);
|
|
831
|
+
const mappingState = resolveCharacterMapping(props);
|
|
832
|
+
const { atlasTexture, ownsAtlasTexture } = getTextAtlasTexture(device, props, mappingState.fontAtlas);
|
|
833
|
+
const useGpuUtf8Decode = Boolean((0, import_text_experimental.supportsGpuUtf8TextExpansion)(device) && mappingState.characterSet && (0, import_arrow_text.isArrowUtf8Vector)(textInputs.texts));
|
|
834
|
+
const hasGlyphRowIndices = props.rowIndexColumn === true;
|
|
835
|
+
const compactGlyphVertexByteStride = hasGlyphRowIndices ? import_text_experimental.ROW_INDEXED_COMPACT_GLYPH_VERTEX_BYTE_STRIDE : COMPACT_GLYPH_VERTEX_BYTE_STRIDE;
|
|
836
|
+
let glyphStream;
|
|
837
|
+
let glyphFrames;
|
|
838
|
+
let utf8GlyphDefinitions;
|
|
839
|
+
let glyphCount = 0;
|
|
840
|
+
let glyphAttributeBuildTimeMs = 0;
|
|
841
|
+
let compactStreamByteLength = 0;
|
|
842
|
+
let generatedRenderBufferByteLength = 0;
|
|
843
|
+
let renderControlByteLength = 0;
|
|
844
|
+
let rowStorageByteLength = 0;
|
|
845
|
+
let glyphDefinitionStorageByteLength = 0;
|
|
846
|
+
let transientComputeInputByteLength = 0;
|
|
847
|
+
const ownedRowStorageResources = [];
|
|
848
|
+
const ownedGlyphResources = [];
|
|
849
|
+
const batches = [];
|
|
850
|
+
const renderBatches = [];
|
|
851
|
+
const defaultBuffers = createTextStorageDefaultBuffers(device, props);
|
|
852
|
+
ownedRowStorageResources.push(...defaultBuffers.ownedResources);
|
|
853
|
+
rowStorageByteLength += defaultBuffers.byteLength;
|
|
854
|
+
if (useGpuUtf8Decode) {
|
|
855
|
+
const glyphDefinitions = (0, import_text_experimental.buildTextGpuGlyphDefinitions)(mappingState.characterSet, {
|
|
856
|
+
fontAtlas: mappingState.fontAtlas,
|
|
857
|
+
lineHeight: mappingState.lineHeight
|
|
858
|
+
});
|
|
859
|
+
utf8GlyphDefinitions = glyphDefinitions;
|
|
860
|
+
glyphFrames = createTextStorageGlyphFrames(device, props, glyphDefinitions.glyphFrames);
|
|
861
|
+
glyphDefinitionStorageByteLength = glyphFrames.byteLength;
|
|
862
|
+
for (const [rowBindingBatchIndex, batchInput] of textInputs.batches.entries()) {
|
|
863
|
+
const rowState = createTextStorageBatchRowState(device, props, batchInput, defaultBuffers, mappingState.fontRenderSettings);
|
|
864
|
+
const utf8TextInput = (0, import_arrow_text.buildGpuUtf8TextInput)(batchInput.texts);
|
|
865
|
+
const rowGlyphStarts = createStorageRowGlyphStartsBuffer(device, props, batchInput.batchRowIndexBase, utf8TextInput.startIndices);
|
|
866
|
+
ownedGlyphResources.push(rowGlyphStarts.buffer);
|
|
867
|
+
renderControlByteLength += rowGlyphStarts.byteLength;
|
|
868
|
+
const glyphMetrics = (0, import_text_experimental.createTextStorageGlyphMetrics)(device, { id: props.id }, glyphDefinitions.glyphMetrics);
|
|
869
|
+
const glyphLookup = (0, import_text_experimental.createTextStorageGlyphLookup)(device, { id: props.id }, glyphDefinitions.glyphLookup);
|
|
870
|
+
const glyphPages = (0, import_text_experimental.createTextStorageGlyphPages)(device, { id: props.id }, glyphDefinitions.glyphPages);
|
|
871
|
+
const glyphKernings = (0, import_text_experimental.createTextStorageGlyphKernings)(device, { id: props.id }, glyphDefinitions.glyphKernings);
|
|
872
|
+
const generatedBufferBatches = (0, import_gpu_tables.planGeneratedBufferBatches)({
|
|
873
|
+
device,
|
|
874
|
+
recordOffsets: utf8TextInput.startIndices,
|
|
875
|
+
recordByteStride: compactGlyphVertexByteStride,
|
|
876
|
+
maxBatchByteLength: device.limits.maxStorageBufferBindingSize,
|
|
877
|
+
resourceLabel: "ArrowTextStorageModel UTF-8 generated glyph vertex data"
|
|
878
|
+
});
|
|
879
|
+
for (const generatedBufferBatch of generatedBufferBatches) {
|
|
880
|
+
const partitionedUtf8TextInput = createPartitionedGpuUtf8TextInput(utf8TextInput, generatedBufferBatch);
|
|
881
|
+
const utf8Input = (0, import_text_experimental.createGpuUtf8ExpandedInput)(device, { id: props.id }, {
|
|
882
|
+
utf8TextInput: partitionedUtf8TextInput,
|
|
883
|
+
baselineOffsetY: glyphDefinitions.baselineOffsetY,
|
|
884
|
+
glyphLookupCount: glyphDefinitions.glyphLookup.length / 2,
|
|
885
|
+
labelCount: generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart,
|
|
886
|
+
batchRowIndexBase: generatedBufferBatch.rowStart,
|
|
887
|
+
rowStorageIndexBase: batchInput.rowStorageIndexBase + generatedBufferBatch.rowStart,
|
|
888
|
+
alignment: createGpuTextAlignmentOptions(props, rowState, mappingState.lineHeight)
|
|
889
|
+
});
|
|
890
|
+
const generated = (0, import_text_experimental.createGpuExpandedGeneratedState)(device, { id: props.id }, partitionedUtf8TextInput.byteLength, hasGlyphRowIndices);
|
|
891
|
+
(0, import_text_experimental.dispatchGpuUtf8ExpandedTextCompute)(device, { id: props.id }, {
|
|
892
|
+
utf8Input,
|
|
893
|
+
glyphLookup,
|
|
894
|
+
glyphMetrics,
|
|
895
|
+
glyphPages,
|
|
896
|
+
glyphKernings,
|
|
897
|
+
generated,
|
|
898
|
+
outputSlotCount: partitionedUtf8TextInput.byteLength,
|
|
899
|
+
labelCount: generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart,
|
|
900
|
+
alignment: {
|
|
901
|
+
rowTextAnchorsBuffer: getComputeTextStorageBuffer(rowState.rowTextAnchorsBuffer),
|
|
902
|
+
rowAlignmentBaselinesBuffer: getComputeTextStorageBuffer(rowState.rowAlignmentBaselinesBuffer)
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
const storageRenderConfigBuffer = createStorageRenderConfigBuffer(device, props, batchInput.batchRowIndexBase, generatedBufferBatch);
|
|
906
|
+
renderBatches.push({
|
|
907
|
+
rowBindingBatchIndex,
|
|
908
|
+
rowStart: generatedBufferBatch.rowStart,
|
|
909
|
+
rowEnd: generatedBufferBatch.rowEnd,
|
|
910
|
+
glyphIndexBase: generatedBufferBatch.recordStart,
|
|
911
|
+
glyphCount: partitionedUtf8TextInput.byteLength,
|
|
912
|
+
compactGlyphVertexData: generated.compactGlyphVertexData,
|
|
913
|
+
storageRenderConfigBuffer
|
|
914
|
+
});
|
|
915
|
+
ownedGlyphResources.push(storageRenderConfigBuffer);
|
|
916
|
+
renderControlByteLength += storageRenderConfigBuffer.byteLength;
|
|
917
|
+
generatedRenderBufferByteLength += generated.byteLength;
|
|
918
|
+
transientComputeInputByteLength += utf8Input.byteLength;
|
|
919
|
+
utf8Input.rowByteRangesBuffer.destroy();
|
|
920
|
+
utf8Input.utf8BytesBuffer.destroy();
|
|
921
|
+
utf8Input.expansionConfigBuffer.destroy();
|
|
922
|
+
}
|
|
923
|
+
batches.push({
|
|
924
|
+
...rowState,
|
|
925
|
+
batchRowIndexBase: batchInput.batchRowIndexBase,
|
|
926
|
+
rowCount: batchInput.texts.length,
|
|
927
|
+
glyphCount: utf8TextInput.byteLength,
|
|
928
|
+
rowGlyphStartsBuffer: rowGlyphStarts.buffer
|
|
929
|
+
});
|
|
930
|
+
glyphCount += utf8TextInput.byteLength;
|
|
931
|
+
glyphAttributeBuildTimeMs += utf8TextInput.textInputBuildTimeMs;
|
|
932
|
+
compactStreamByteLength += utf8TextInput.inputByteLength;
|
|
933
|
+
rowStorageByteLength += rowState.ownedByteLength;
|
|
934
|
+
transientComputeInputByteLength += glyphLookup.byteLength + glyphMetrics.byteLength + glyphPages.byteLength + glyphKernings.byteLength;
|
|
935
|
+
ownedRowStorageResources.push(...rowState.ownedResources);
|
|
936
|
+
glyphMetrics.buffer.destroy();
|
|
937
|
+
glyphLookup.buffer.destroy();
|
|
938
|
+
glyphPages.buffer.destroy();
|
|
939
|
+
glyphKernings.buffer.destroy();
|
|
940
|
+
}
|
|
941
|
+
} else {
|
|
942
|
+
for (const [batchIndex, batchInput] of textInputs.batches.entries()) {
|
|
943
|
+
const rowState = createTextStorageBatchRowState(device, props, batchInput, defaultBuffers, mappingState.fontRenderSettings);
|
|
944
|
+
const batchGlyphStream = (0, import_arrow_text.buildGpuExpandedTextStream)({
|
|
945
|
+
texts: batchInput.texts,
|
|
946
|
+
fontAtlas: mappingState.fontAtlas,
|
|
947
|
+
lineHeight: mappingState.lineHeight,
|
|
948
|
+
characterSet: mappingState.characterSet
|
|
949
|
+
});
|
|
950
|
+
const rowGlyphStarts = createStorageRowGlyphStartsBuffer(device, props, batchInput.batchRowIndexBase, batchGlyphStream.startIndices);
|
|
951
|
+
ownedGlyphResources.push(rowGlyphStarts.buffer);
|
|
952
|
+
renderControlByteLength += rowGlyphStarts.byteLength;
|
|
953
|
+
glyphStream ??= batchGlyphStream;
|
|
954
|
+
glyphFrames ??= createTextStorageGlyphFrames(device, props, batchGlyphStream.glyphFrames);
|
|
955
|
+
if (batchIndex === 0) {
|
|
956
|
+
glyphDefinitionStorageByteLength = glyphFrames.byteLength;
|
|
957
|
+
}
|
|
958
|
+
const glyphMetrics = (0, import_text_experimental.createTextStorageGlyphMetrics)(device, { id: props.id }, batchGlyphStream.glyphMetrics);
|
|
959
|
+
const glyphPages = (0, import_text_experimental.createTextStorageGlyphPages)(device, { id: props.id }, batchGlyphStream.glyphPages);
|
|
960
|
+
const glyphKernings = (0, import_text_experimental.createTextStorageGlyphKernings)(device, { id: props.id }, batchGlyphStream.glyphKernings);
|
|
961
|
+
const generatedBufferBatches = (0, import_gpu_tables.planGeneratedBufferBatches)({
|
|
962
|
+
device,
|
|
963
|
+
recordOffsets: batchGlyphStream.startIndices,
|
|
964
|
+
recordByteStride: compactGlyphVertexByteStride,
|
|
965
|
+
maxBatchByteLength: device.limits.maxStorageBufferBindingSize,
|
|
966
|
+
resourceLabel: "ArrowTextStorageModel compact generated glyph vertex data"
|
|
967
|
+
});
|
|
968
|
+
for (const generatedBufferBatch of generatedBufferBatches) {
|
|
969
|
+
const partitionedGlyphStream = createPartitionedGpuExpandedTextStream(batchGlyphStream, generatedBufferBatch);
|
|
970
|
+
const compactInput = (0, import_text_experimental.createGpuExpandedCompactInput)(device, { id: props.id }, partitionedGlyphStream, generatedBufferBatch.rowStart, createGpuTextAlignmentOptions(props, rowState, mappingState.lineHeight), batchInput.rowStorageIndexBase + generatedBufferBatch.rowStart);
|
|
971
|
+
const generated = (0, import_text_experimental.createGpuExpandedGeneratedState)(device, { id: props.id }, partitionedGlyphStream.glyphCount, hasGlyphRowIndices);
|
|
972
|
+
(0, import_text_experimental.dispatchGpuExpandedTextCompute)(device, { id: props.id }, {
|
|
973
|
+
compactInput,
|
|
974
|
+
glyphMetrics,
|
|
975
|
+
glyphPages,
|
|
976
|
+
glyphKernings,
|
|
977
|
+
generated,
|
|
978
|
+
glyphCount: partitionedGlyphStream.glyphCount,
|
|
979
|
+
labelCount: generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart,
|
|
980
|
+
alignment: {
|
|
981
|
+
rowTextAnchorsBuffer: getComputeTextStorageBuffer(rowState.rowTextAnchorsBuffer),
|
|
982
|
+
rowAlignmentBaselinesBuffer: getComputeTextStorageBuffer(rowState.rowAlignmentBaselinesBuffer),
|
|
983
|
+
useRowTextAnchors: Boolean(props.textAnchors),
|
|
984
|
+
useRowAlignmentBaselines: Boolean(props.alignmentBaselines)
|
|
985
|
+
}
|
|
986
|
+
});
|
|
987
|
+
const storageRenderConfigBuffer = createStorageRenderConfigBuffer(device, props, batchInput.batchRowIndexBase, generatedBufferBatch);
|
|
988
|
+
renderBatches.push({
|
|
989
|
+
rowBindingBatchIndex: batchIndex,
|
|
990
|
+
rowStart: generatedBufferBatch.rowStart,
|
|
991
|
+
rowEnd: generatedBufferBatch.rowEnd,
|
|
992
|
+
glyphIndexBase: generatedBufferBatch.recordStart,
|
|
993
|
+
glyphCount: partitionedGlyphStream.glyphCount,
|
|
994
|
+
compactGlyphVertexData: generated.compactGlyphVertexData,
|
|
995
|
+
storageRenderConfigBuffer
|
|
996
|
+
});
|
|
997
|
+
ownedGlyphResources.push(storageRenderConfigBuffer);
|
|
998
|
+
renderControlByteLength += storageRenderConfigBuffer.byteLength;
|
|
999
|
+
generatedRenderBufferByteLength += generated.byteLength;
|
|
1000
|
+
transientComputeInputByteLength += compactInput.byteLength;
|
|
1001
|
+
compactInput.glyphRangesBuffer.destroy();
|
|
1002
|
+
compactInput.glyphIdsBuffer.destroy();
|
|
1003
|
+
compactInput.expansionConfigBuffer.destroy();
|
|
1004
|
+
}
|
|
1005
|
+
batches.push({
|
|
1006
|
+
...rowState,
|
|
1007
|
+
batchRowIndexBase: batchInput.batchRowIndexBase,
|
|
1008
|
+
rowCount: batchInput.texts.length,
|
|
1009
|
+
glyphCount: batchGlyphStream.glyphCount,
|
|
1010
|
+
rowGlyphStartsBuffer: rowGlyphStarts.buffer
|
|
1011
|
+
});
|
|
1012
|
+
glyphCount += batchGlyphStream.glyphCount;
|
|
1013
|
+
glyphAttributeBuildTimeMs += batchGlyphStream.glyphStreamBuildTimeMs;
|
|
1014
|
+
compactStreamByteLength += batchGlyphStream.compactStreamByteLength;
|
|
1015
|
+
rowStorageByteLength += rowState.ownedByteLength;
|
|
1016
|
+
transientComputeInputByteLength += glyphMetrics.byteLength + glyphPages.byteLength + glyphKernings.byteLength;
|
|
1017
|
+
ownedRowStorageResources.push(...rowState.ownedResources);
|
|
1018
|
+
glyphMetrics.buffer.destroy();
|
|
1019
|
+
glyphPages.buffer.destroy();
|
|
1020
|
+
glyphKernings.buffer.destroy();
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
glyphFrames ??= createTextStorageGlyphFrames(device, props, new Float32Array(4));
|
|
1024
|
+
let destroyed = false;
|
|
1025
|
+
const storageState = {
|
|
1026
|
+
glyphStream,
|
|
1027
|
+
atlasTexture,
|
|
1028
|
+
characterSet: mappingState.characterSet,
|
|
1029
|
+
glyphCount,
|
|
1030
|
+
glyphAttributeBuildTimeMs,
|
|
1031
|
+
glyphAttributeByteLength: generatedRenderBufferByteLength + renderControlByteLength,
|
|
1032
|
+
compactStreamBuildTimeMs: glyphAttributeBuildTimeMs,
|
|
1033
|
+
compactStreamByteLength,
|
|
1034
|
+
generatedRenderBufferByteLength,
|
|
1035
|
+
renderControlByteLength,
|
|
1036
|
+
rowStorageByteLength,
|
|
1037
|
+
glyphDefinitionStorageByteLength,
|
|
1038
|
+
transientComputeInputByteLength,
|
|
1039
|
+
hasGlyphRowIndices,
|
|
1040
|
+
fontRenderSettings: mappingState.fontRenderSettings,
|
|
1041
|
+
batches,
|
|
1042
|
+
renderBatches,
|
|
1043
|
+
ownedRowBindingResources: ownedRowStorageResources,
|
|
1044
|
+
ownedGlyphResources,
|
|
1045
|
+
glyphFramesBuffer: glyphFrames.buffer,
|
|
1046
|
+
arrowAppendContext: {
|
|
1047
|
+
defaultBuffers,
|
|
1048
|
+
mappingState,
|
|
1049
|
+
useGpuUtf8Decode,
|
|
1050
|
+
utf8GlyphDefinitions
|
|
1051
|
+
},
|
|
1052
|
+
destroy: () => {
|
|
1053
|
+
if (destroyed) {
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
destroyed = true;
|
|
1057
|
+
if (ownsAtlasTexture) {
|
|
1058
|
+
atlasTexture.destroy();
|
|
1059
|
+
}
|
|
1060
|
+
destroyTextStorageResources(ownedRowStorageResources);
|
|
1061
|
+
destroyTextStorageResources(ownedGlyphResources);
|
|
1062
|
+
glyphFrames.buffer.destroy();
|
|
1063
|
+
for (const renderBatch of renderBatches) {
|
|
1064
|
+
renderBatch.compactGlyphVertexData.destroy();
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
};
|
|
1068
|
+
return storageState;
|
|
1069
|
+
}
|
|
1070
|
+
function createTextStorageStateFromGPUVectors(device, props) {
|
|
1071
|
+
if (device.type !== "webgpu") {
|
|
1072
|
+
throw new Error("createTextStorageStateFromGPUVectors requires a WebGPU device");
|
|
1073
|
+
}
|
|
1074
|
+
if (!(0, import_text_experimental.supportsGpuUtf8TextExpansion)(device)) {
|
|
1075
|
+
throw new Error(`createTextStorageStateFromGPUVectors requires at least ${import_text_experimental.GPU_UTF8_TEXT_EXPANSION_STORAGE_BUFFER_COUNT} storage buffer bindings per shader stage`);
|
|
1076
|
+
}
|
|
1077
|
+
const textInputs = resolveGPUVectorTextStorageInputs(device, props);
|
|
1078
|
+
const mappingState = resolveGPUVectorStorageCharacterMapping(props);
|
|
1079
|
+
const characterSet = mappingState.characterSet ?? new Set(Object.keys(mappingState.fontAtlas.mapping));
|
|
1080
|
+
const { atlasTexture, ownsAtlasTexture } = getTextAtlasTexture(device, props, mappingState.fontAtlas);
|
|
1081
|
+
const glyphDefinitions = (0, import_text_experimental.buildTextGpuGlyphDefinitions)(characterSet, {
|
|
1082
|
+
fontAtlas: mappingState.fontAtlas,
|
|
1083
|
+
lineHeight: mappingState.lineHeight
|
|
1084
|
+
});
|
|
1085
|
+
const glyphFrames = createTextStorageGlyphFrames(device, props, glyphDefinitions.glyphFrames);
|
|
1086
|
+
const hasGlyphRowIndices = props.rowIndexColumn === true;
|
|
1087
|
+
const compactGlyphVertexByteStride = hasGlyphRowIndices ? import_text_experimental.ROW_INDEXED_COMPACT_GLYPH_VERTEX_BYTE_STRIDE : COMPACT_GLYPH_VERTEX_BYTE_STRIDE;
|
|
1088
|
+
let glyphCount = 0;
|
|
1089
|
+
let compactStreamByteLength = 0;
|
|
1090
|
+
let generatedRenderBufferByteLength = 0;
|
|
1091
|
+
let renderControlByteLength = 0;
|
|
1092
|
+
let rowStorageByteLength = 0;
|
|
1093
|
+
let transientComputeInputByteLength = 0;
|
|
1094
|
+
const ownedRowStorageResources = [];
|
|
1095
|
+
const ownedGlyphResources = [];
|
|
1096
|
+
const batches = [];
|
|
1097
|
+
const renderBatches = [];
|
|
1098
|
+
const defaultBuffers = createTextStorageDefaultBuffers(device, props);
|
|
1099
|
+
ownedRowStorageResources.push(...defaultBuffers.ownedResources);
|
|
1100
|
+
rowStorageByteLength += defaultBuffers.byteLength;
|
|
1101
|
+
for (const [rowBindingBatchIndex, batchInput] of textInputs.batches.entries()) {
|
|
1102
|
+
const rowState = createTextStorageBatchRowState(device, props, batchInput, defaultBuffers, mappingState.fontRenderSettings);
|
|
1103
|
+
const rowGlyphStarts = createStorageRowGlyphStartsBuffer(device, props, batchInput.batchRowIndexBase, batchInput.startIndices);
|
|
1104
|
+
ownedGlyphResources.push(rowGlyphStarts.buffer);
|
|
1105
|
+
renderControlByteLength += rowGlyphStarts.byteLength;
|
|
1106
|
+
const glyphMetrics = (0, import_text_experimental.createTextStorageGlyphMetrics)(device, { id: props.id }, glyphDefinitions.glyphMetrics);
|
|
1107
|
+
const glyphPages = (0, import_text_experimental.createTextStorageGlyphPages)(device, { id: props.id }, glyphDefinitions.glyphPages);
|
|
1108
|
+
const glyphKernings = (0, import_text_experimental.createTextStorageGlyphKernings)(device, { id: props.id }, glyphDefinitions.glyphKernings);
|
|
1109
|
+
const glyphLookup = (0, import_text_experimental.createTextStorageGlyphLookup)(device, { id: props.id }, glyphDefinitions.glyphLookup);
|
|
1110
|
+
const generatedBufferBatches = (0, import_gpu_tables.planGeneratedBufferBatches)({
|
|
1111
|
+
device,
|
|
1112
|
+
recordOffsets: batchInput.startIndices,
|
|
1113
|
+
recordByteStride: compactGlyphVertexByteStride,
|
|
1114
|
+
maxBatchByteLength: device.limits.maxStorageBufferBindingSize,
|
|
1115
|
+
resourceLabel: "TextStorageModel GPUVector UTF-8 generated glyph vertex data"
|
|
1116
|
+
});
|
|
1117
|
+
for (const generatedBufferBatch of generatedBufferBatches) {
|
|
1118
|
+
const partitionedInput = createPartitionedGpuVectorUtf8TextInput(device, props, batchInput, generatedBufferBatch);
|
|
1119
|
+
const utf8Input = (0, import_text_experimental.createGpuUtf8ExpandedInputFromBuffers)(device, { id: props.id }, {
|
|
1120
|
+
rowByteRangesBuffer: partitionedInput.rowByteRangesBuffer,
|
|
1121
|
+
utf8BytesBuffer: getComputeTextStorageBuffer(batchInput.utf8BytesBuffer),
|
|
1122
|
+
inputByteLength: partitionedInput.inputByteLength,
|
|
1123
|
+
baselineOffsetY: glyphDefinitions.baselineOffsetY,
|
|
1124
|
+
glyphLookupCount: glyphDefinitions.glyphLookup.length / 2,
|
|
1125
|
+
labelCount: generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart,
|
|
1126
|
+
batchRowIndexBase: generatedBufferBatch.rowStart,
|
|
1127
|
+
rowStorageIndexBase: batchInput.rowStorageIndexBase + generatedBufferBatch.rowStart,
|
|
1128
|
+
outputByteBase: generatedBufferBatch.recordStart,
|
|
1129
|
+
alignment: createGpuTextAlignmentOptions(props, rowState, mappingState.lineHeight)
|
|
1130
|
+
});
|
|
1131
|
+
const generated = (0, import_text_experimental.createGpuExpandedGeneratedState)(device, { id: props.id }, generatedBufferBatch.recordCount, hasGlyphRowIndices);
|
|
1132
|
+
(0, import_text_experimental.dispatchGpuUtf8ExpandedTextCompute)(device, { id: props.id }, {
|
|
1133
|
+
utf8Input,
|
|
1134
|
+
glyphLookup,
|
|
1135
|
+
glyphMetrics,
|
|
1136
|
+
glyphPages,
|
|
1137
|
+
glyphKernings,
|
|
1138
|
+
generated,
|
|
1139
|
+
outputSlotCount: generatedBufferBatch.recordCount,
|
|
1140
|
+
labelCount: generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart,
|
|
1141
|
+
alignment: {
|
|
1142
|
+
rowTextAnchorsBuffer: getComputeTextStorageBuffer(rowState.rowTextAnchorsBuffer),
|
|
1143
|
+
rowAlignmentBaselinesBuffer: getComputeTextStorageBuffer(rowState.rowAlignmentBaselinesBuffer)
|
|
1144
|
+
}
|
|
1145
|
+
});
|
|
1146
|
+
const storageRenderConfigBuffer = createStorageRenderConfigBuffer(device, props, batchInput.batchRowIndexBase, generatedBufferBatch);
|
|
1147
|
+
renderBatches.push({
|
|
1148
|
+
rowBindingBatchIndex,
|
|
1149
|
+
rowStart: generatedBufferBatch.rowStart,
|
|
1150
|
+
rowEnd: generatedBufferBatch.rowEnd,
|
|
1151
|
+
glyphIndexBase: generatedBufferBatch.recordStart,
|
|
1152
|
+
glyphCount: generatedBufferBatch.recordCount,
|
|
1153
|
+
compactGlyphVertexData: generated.compactGlyphVertexData,
|
|
1154
|
+
storageRenderConfigBuffer
|
|
1155
|
+
});
|
|
1156
|
+
ownedGlyphResources.push(storageRenderConfigBuffer);
|
|
1157
|
+
renderControlByteLength += storageRenderConfigBuffer.byteLength;
|
|
1158
|
+
generatedRenderBufferByteLength += generated.byteLength;
|
|
1159
|
+
transientComputeInputByteLength += utf8Input.byteLength;
|
|
1160
|
+
utf8Input.expansionConfigBuffer.destroy();
|
|
1161
|
+
if (partitionedInput.ownsRowByteRangesBuffer) {
|
|
1162
|
+
partitionedInput.rowByteRangesBuffer.destroy();
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
batches.push({
|
|
1166
|
+
...rowState,
|
|
1167
|
+
batchRowIndexBase: batchInput.batchRowIndexBase,
|
|
1168
|
+
rowCount: batchInput.rowCount,
|
|
1169
|
+
glyphCount: batchInput.byteLength,
|
|
1170
|
+
rowGlyphStartsBuffer: rowGlyphStarts.buffer
|
|
1171
|
+
});
|
|
1172
|
+
glyphCount += batchInput.byteLength;
|
|
1173
|
+
compactStreamByteLength += batchInput.inputByteLength;
|
|
1174
|
+
rowStorageByteLength += rowState.ownedByteLength;
|
|
1175
|
+
transientComputeInputByteLength += glyphLookup.byteLength + glyphMetrics.byteLength + glyphPages.byteLength + glyphKernings.byteLength;
|
|
1176
|
+
ownedRowStorageResources.push(...rowState.ownedResources);
|
|
1177
|
+
glyphMetrics.buffer.destroy();
|
|
1178
|
+
glyphLookup.buffer.destroy();
|
|
1179
|
+
glyphPages.buffer.destroy();
|
|
1180
|
+
glyphKernings.buffer.destroy();
|
|
1181
|
+
if (batchInput.ownsRowByteRangesBuffer) {
|
|
1182
|
+
batchInput.rowByteRangesBuffer.destroy();
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
let destroyed = false;
|
|
1186
|
+
return {
|
|
1187
|
+
atlasTexture,
|
|
1188
|
+
characterSet,
|
|
1189
|
+
glyphCount,
|
|
1190
|
+
glyphAttributeBuildTimeMs: 0,
|
|
1191
|
+
glyphAttributeByteLength: generatedRenderBufferByteLength + renderControlByteLength,
|
|
1192
|
+
compactStreamBuildTimeMs: 0,
|
|
1193
|
+
compactStreamByteLength,
|
|
1194
|
+
generatedRenderBufferByteLength,
|
|
1195
|
+
renderControlByteLength,
|
|
1196
|
+
rowStorageByteLength,
|
|
1197
|
+
glyphDefinitionStorageByteLength: glyphFrames.byteLength,
|
|
1198
|
+
transientComputeInputByteLength,
|
|
1199
|
+
hasGlyphRowIndices,
|
|
1200
|
+
fontRenderSettings: mappingState.fontRenderSettings,
|
|
1201
|
+
glyphFramesBuffer: glyphFrames.buffer,
|
|
1202
|
+
batches,
|
|
1203
|
+
renderBatches,
|
|
1204
|
+
ownedRowBindingResources: ownedRowStorageResources,
|
|
1205
|
+
ownedGlyphResources,
|
|
1206
|
+
destroy: () => {
|
|
1207
|
+
if (destroyed) {
|
|
1208
|
+
return;
|
|
1209
|
+
}
|
|
1210
|
+
destroyed = true;
|
|
1211
|
+
if (ownsAtlasTexture) {
|
|
1212
|
+
atlasTexture.destroy();
|
|
1213
|
+
}
|
|
1214
|
+
destroyTextStorageResources(ownedRowStorageResources);
|
|
1215
|
+
destroyTextStorageResources(ownedGlyphResources);
|
|
1216
|
+
glyphFrames.buffer.destroy();
|
|
1217
|
+
for (const renderBatch of renderBatches) {
|
|
1218
|
+
renderBatch.compactGlyphVertexData.destroy();
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
function createArrowTextDictionaryStorageState(device, props) {
|
|
1224
|
+
if (device.type !== "webgpu") {
|
|
1225
|
+
throw new Error("createArrowTextDictionaryStorageState requires a WebGPU device");
|
|
1226
|
+
}
|
|
1227
|
+
const textInputs = resolveArrowTextDictionaryStorageInputs(props);
|
|
1228
|
+
const mappingState = resolveCharacterMapping(props);
|
|
1229
|
+
const { atlasTexture, ownsAtlasTexture } = getTextAtlasTexture(device, props, mappingState.fontAtlas);
|
|
1230
|
+
let glyphStream;
|
|
1231
|
+
let glyphCount = 0;
|
|
1232
|
+
let dictionaryGlyphCount = 0;
|
|
1233
|
+
let dictionaryValueCount = 0;
|
|
1234
|
+
let glyphAttributeBuildTimeMs = 0;
|
|
1235
|
+
let compactStreamByteLength = 0;
|
|
1236
|
+
let generatedRenderBufferByteLength = 0;
|
|
1237
|
+
let rowStorageByteLength = 0;
|
|
1238
|
+
let glyphDefinitionStorageByteLength = 0;
|
|
1239
|
+
const ownedRowStorageResources = [];
|
|
1240
|
+
const ownedDictionaryResources = [];
|
|
1241
|
+
const batches = [];
|
|
1242
|
+
const renderBatches = [];
|
|
1243
|
+
const defaultBuffers = createTextStorageDefaultBuffers(device, props);
|
|
1244
|
+
ownedRowStorageResources.push(...defaultBuffers.ownedResources);
|
|
1245
|
+
rowStorageByteLength += defaultBuffers.byteLength;
|
|
1246
|
+
for (const [rowBindingBatchIndex, batchInput] of textInputs.batches.entries()) {
|
|
1247
|
+
const rowState = createTextStorageBatchRowState(device, props, batchInput, defaultBuffers, mappingState.fontRenderSettings);
|
|
1248
|
+
const batchGlyphStream = (0, import_arrow_text.buildGpuTextDictionaryCompressedStream)({
|
|
1249
|
+
texts: batchInput.texts,
|
|
1250
|
+
fontAtlas: mappingState.fontAtlas,
|
|
1251
|
+
lineHeight: mappingState.lineHeight,
|
|
1252
|
+
characterSet: mappingState.characterSet
|
|
1253
|
+
});
|
|
1254
|
+
const rowDictionaryRecords = createTextDictionaryRowRecords(batchGlyphStream);
|
|
1255
|
+
const rowDictionaryRecordsBuffer = createTextDictionaryStorageBuffer(device, props, `row-dictionary-records-${batchInput.batchRowIndexBase}`, rowDictionaryRecords, new Uint32Array(2));
|
|
1256
|
+
const dictionaryGlyphRangesBuffer = createTextDictionaryStorageBuffer(device, props, `dictionary-glyph-ranges-${batchInput.batchRowIndexBase}`, batchGlyphStream.dictionaryGlyphRanges, new Uint32Array(2));
|
|
1257
|
+
const dictionaryGlyphRecordsBuffer = createTextDictionaryStorageBuffer(device, props, `dictionary-glyph-records-${batchInput.batchRowIndexBase}`, batchGlyphStream.dictionaryGlyphRecords, new Uint32Array(2));
|
|
1258
|
+
const glyphFrames = createTextStorageGlyphFrames(device, props, batchGlyphStream.glyphFrames);
|
|
1259
|
+
const generatedBufferBatches = (0, import_gpu_tables.planGeneratedBufferBatches)({
|
|
1260
|
+
device,
|
|
1261
|
+
recordOffsets: batchGlyphStream.startIndices,
|
|
1262
|
+
// The dictionary model does not allocate a generated vertex buffer; the
|
|
1263
|
+
// planner is used only to split draw instance counts by device limits.
|
|
1264
|
+
recordByteStride: 1,
|
|
1265
|
+
maxBatchByteLength: device.limits.maxStorageBufferBindingSize,
|
|
1266
|
+
resourceLabel: "ArrowTextDictionaryStorageModel glyph instances"
|
|
1267
|
+
});
|
|
1268
|
+
for (const generatedBufferBatch of generatedBufferBatches) {
|
|
1269
|
+
const dictionaryRenderConfigBuffer = createTextDictionaryRenderConfigBuffer(device, props, batchInput.batchRowIndexBase, generatedBufferBatch);
|
|
1270
|
+
renderBatches.push({
|
|
1271
|
+
rowBindingBatchIndex,
|
|
1272
|
+
rowStart: generatedBufferBatch.rowStart,
|
|
1273
|
+
rowEnd: generatedBufferBatch.rowEnd,
|
|
1274
|
+
glyphIndexBase: generatedBufferBatch.recordStart,
|
|
1275
|
+
glyphCount: generatedBufferBatch.recordCount,
|
|
1276
|
+
dictionaryRenderConfigBuffer
|
|
1277
|
+
});
|
|
1278
|
+
ownedDictionaryResources.push(dictionaryRenderConfigBuffer);
|
|
1279
|
+
compactStreamByteLength += dictionaryRenderConfigBuffer.byteLength;
|
|
1280
|
+
}
|
|
1281
|
+
batches.push({
|
|
1282
|
+
...rowState,
|
|
1283
|
+
batchRowIndexBase: batchInput.batchRowIndexBase,
|
|
1284
|
+
rowCount: batchInput.texts.length,
|
|
1285
|
+
glyphCount: batchGlyphStream.glyphCount,
|
|
1286
|
+
rowDictionaryRecordsBuffer,
|
|
1287
|
+
dictionaryGlyphRangesBuffer,
|
|
1288
|
+
dictionaryGlyphRecordsBuffer,
|
|
1289
|
+
glyphFramesBuffer: glyphFrames.buffer,
|
|
1290
|
+
dictionaryGlyphCount: batchGlyphStream.dictionaryGlyphCount,
|
|
1291
|
+
dictionaryValueCount: batchGlyphStream.dictionaryValueCount
|
|
1292
|
+
});
|
|
1293
|
+
glyphStream ??= batchGlyphStream;
|
|
1294
|
+
glyphCount += batchGlyphStream.glyphCount;
|
|
1295
|
+
dictionaryGlyphCount += batchGlyphStream.dictionaryGlyphCount;
|
|
1296
|
+
dictionaryValueCount += batchGlyphStream.dictionaryValueCount;
|
|
1297
|
+
glyphAttributeBuildTimeMs += batchGlyphStream.glyphStreamBuildTimeMs;
|
|
1298
|
+
compactStreamByteLength += rowDictionaryRecords.byteLength + batchGlyphStream.dictionaryGlyphRanges.byteLength + batchGlyphStream.dictionaryGlyphRecords.byteLength;
|
|
1299
|
+
rowStorageByteLength += rowState.ownedByteLength;
|
|
1300
|
+
glyphDefinitionStorageByteLength += glyphFrames.byteLength;
|
|
1301
|
+
ownedRowStorageResources.push(...rowState.ownedResources);
|
|
1302
|
+
ownedDictionaryResources.push(rowDictionaryRecordsBuffer, dictionaryGlyphRangesBuffer, dictionaryGlyphRecordsBuffer, glyphFrames.buffer);
|
|
1303
|
+
}
|
|
1304
|
+
let destroyed = false;
|
|
1305
|
+
const storageState = {
|
|
1306
|
+
glyphStream,
|
|
1307
|
+
atlasTexture,
|
|
1308
|
+
characterSet: mappingState.characterSet,
|
|
1309
|
+
glyphCount,
|
|
1310
|
+
dictionaryGlyphCount,
|
|
1311
|
+
dictionaryValueCount,
|
|
1312
|
+
glyphAttributeBuildTimeMs,
|
|
1313
|
+
glyphAttributeByteLength: generatedRenderBufferByteLength,
|
|
1314
|
+
compactStreamBuildTimeMs: glyphAttributeBuildTimeMs,
|
|
1315
|
+
compactStreamByteLength,
|
|
1316
|
+
generatedRenderBufferByteLength,
|
|
1317
|
+
rowStorageByteLength,
|
|
1318
|
+
glyphDefinitionStorageByteLength,
|
|
1319
|
+
transientComputeInputByteLength: 0,
|
|
1320
|
+
fontRenderSettings: mappingState.fontRenderSettings,
|
|
1321
|
+
batches,
|
|
1322
|
+
renderBatches,
|
|
1323
|
+
ownedRowBindingResources: ownedRowStorageResources,
|
|
1324
|
+
ownedDictionaryResources,
|
|
1325
|
+
destroy: () => {
|
|
1326
|
+
if (destroyed) {
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1329
|
+
destroyed = true;
|
|
1330
|
+
if (ownsAtlasTexture) {
|
|
1331
|
+
atlasTexture.destroy();
|
|
1332
|
+
}
|
|
1333
|
+
destroyTextStorageResources(ownedRowStorageResources);
|
|
1334
|
+
destroyTextStorageResources(ownedDictionaryResources);
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
return storageState;
|
|
1338
|
+
}
|
|
1339
|
+
function createTextDictionaryRenderConfigBuffer(device, props, batchRowIndexBase, generatedBufferBatch) {
|
|
1340
|
+
const data = new Uint32Array(TEXT_DICTIONARY_RENDER_CONFIG_BYTE_LENGTH / Uint32Array.BYTES_PER_ELEMENT);
|
|
1341
|
+
data[0] = generatedBufferBatch.recordStart;
|
|
1342
|
+
data[1] = generatedBufferBatch.rowStart;
|
|
1343
|
+
data[2] = generatedBufferBatch.rowEnd;
|
|
1344
|
+
data[3] = 0;
|
|
1345
|
+
return new import_dynamic.DynamicBuffer(device, {
|
|
1346
|
+
id: `${props.id || "arrow-text-dictionary-storage-model"}-render-config-${batchRowIndexBase}-${generatedBufferBatch.rowStart}`,
|
|
1347
|
+
usage: import_core.Buffer.UNIFORM | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC,
|
|
1348
|
+
data
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
function createStorageRenderConfigBuffer(device, props, batchRowIndexBase, generatedBufferBatch) {
|
|
1352
|
+
const data = new Uint32Array(STORAGE_RENDER_CONFIG_BYTE_LENGTH / Uint32Array.BYTES_PER_ELEMENT);
|
|
1353
|
+
data[0] = generatedBufferBatch.recordStart;
|
|
1354
|
+
data[1] = generatedBufferBatch.rowStart;
|
|
1355
|
+
data[2] = generatedBufferBatch.rowEnd;
|
|
1356
|
+
data[3] = 0;
|
|
1357
|
+
return new import_dynamic.DynamicBuffer(device, {
|
|
1358
|
+
id: `${props.id || "arrow-text-storage-model"}-render-config-${batchRowIndexBase}-${generatedBufferBatch.rowStart}`,
|
|
1359
|
+
usage: import_core.Buffer.UNIFORM | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC,
|
|
1360
|
+
data
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1363
|
+
function createStorageRowGlyphStartsBuffer(device, props, batchRowIndexBase, startIndices) {
|
|
1364
|
+
const rowGlyphStarts = new Uint32Array(startIndices);
|
|
1365
|
+
return {
|
|
1366
|
+
buffer: device.createBuffer({
|
|
1367
|
+
id: `${props.id || "arrow-text-storage-model"}-row-glyph-starts-${batchRowIndexBase}`,
|
|
1368
|
+
usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC,
|
|
1369
|
+
data: rowGlyphStarts.byteLength > 0 ? rowGlyphStarts : new Uint32Array(1)
|
|
1370
|
+
}),
|
|
1371
|
+
byteLength: rowGlyphStarts.byteLength
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
function createTextDictionaryRowRecords(glyphStream) {
|
|
1375
|
+
const rowCount = glyphStream.rowDictionaryIndices.length;
|
|
1376
|
+
const records = new Uint32Array((rowCount + 1) * 2);
|
|
1377
|
+
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
1378
|
+
records[rowIndex * 2] = glyphStream.rowDictionaryIndices[rowIndex] ?? INVALID_DICTIONARY_INDEX;
|
|
1379
|
+
records[rowIndex * 2 + 1] = glyphStream.rowGlyphRanges[rowIndex * 2] ?? 0;
|
|
1380
|
+
}
|
|
1381
|
+
records[rowCount * 2] = INVALID_DICTIONARY_INDEX;
|
|
1382
|
+
records[rowCount * 2 + 1] = glyphStream.glyphCount;
|
|
1383
|
+
return records;
|
|
1384
|
+
}
|
|
1385
|
+
function getNow() {
|
|
1386
|
+
var _a;
|
|
1387
|
+
return ((_a = globalThis.performance) == null ? void 0 : _a.now()) ?? Date.now();
|
|
1388
|
+
}
|
|
1389
|
+
function resolveCharacterMapping(props) {
|
|
1390
|
+
return resolveFontAtlasMapping(props.fontAtlas, props.lineHeight ?? 1);
|
|
1391
|
+
}
|
|
1392
|
+
function resolveGPUVectorStorageCharacterMapping(props) {
|
|
1393
|
+
return resolveFontAtlasMapping(props.fontAtlas, props.lineHeight ?? 1);
|
|
1394
|
+
}
|
|
1395
|
+
function resolveFontAtlasMapping(fontAtlas, lineHeightMultiplier) {
|
|
1396
|
+
return {
|
|
1397
|
+
lineHeight: lineHeightMultiplier * fontAtlas.lineHeight,
|
|
1398
|
+
characterSet: new Set(Object.keys(fontAtlas.mapping)),
|
|
1399
|
+
fontAtlas,
|
|
1400
|
+
fontRenderSettings: fontAtlas.renderSettings
|
|
1401
|
+
};
|
|
1402
|
+
}
|
|
1403
|
+
function assertColumnAvailable(table, columnName) {
|
|
1404
|
+
if (table.getChild(columnName)) {
|
|
1405
|
+
throw new Error(`ArrowTextModel labelTable column "${columnName}" is reserved`);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
function assertClipRects(clipRects, labelCount) {
|
|
1409
|
+
var _a;
|
|
1410
|
+
if (!clipRects) {
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
if (clipRects.length !== labelCount) {
|
|
1414
|
+
throw new Error("ArrowTextModel clipRects rows must match UTF-8 text rows");
|
|
1415
|
+
}
|
|
1416
|
+
if (!import_apache_arrow.DataType.isFixedSizeList(clipRects.type) || clipRects.type.listSize !== 4 || !(((_a = clipRects.type.children[0]) == null ? void 0 : _a.type) instanceof import_apache_arrow.Float32)) {
|
|
1417
|
+
throw new Error("ArrowTextModel clipRects must be FixedSizeList<Float32>[4]");
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
function createTextStorageDefaultBuffers(device, props) {
|
|
1421
|
+
const id = props.id || "text-storage-model";
|
|
1422
|
+
const colorsVector = createTextStorageOwnedGpuVector(device, `${id}-default-row-colors`, (0, import_arrow2.makeArrowFixedSizeListVector)(new import_apache_arrow.Uint8(), 4, new Uint8Array(props.color ?? DEFAULT_TEXT_STORAGE_COLOR)));
|
|
1423
|
+
const anglesVector = createTextStorageOwnedGpuVector(device, `${id}-default-row-angles`, makeNumericArrowVector(new import_apache_arrow.Float32(), new Float32Array([props.angle ?? DEFAULT_TEXT_STORAGE_ANGLE])));
|
|
1424
|
+
const sizesVector = createTextStorageOwnedGpuVector(device, `${id}-default-row-sizes`, makeNumericArrowVector(new import_apache_arrow.Float32(), new Float32Array([props.size ?? DEFAULT_TEXT_STORAGE_SIZE])));
|
|
1425
|
+
const pixelOffsetsVector = createTextStorageOwnedGpuVector(device, `${id}-default-row-pixel-offsets`, (0, import_arrow2.makeArrowFixedSizeListVector)(new import_apache_arrow.Float32(), 2, new Float32Array(props.pixelOffset ?? DEFAULT_TEXT_STORAGE_PIXEL_OFFSET)));
|
|
1426
|
+
const textAnchorsVector = createTextStorageOwnedGpuVector(device, `${id}-default-row-text-anchors`, makeNumericArrowVector(new import_apache_arrow.Uint32(), new Uint32Array([getTextAnchorEnum(props.textAnchor)])));
|
|
1427
|
+
const alignmentBaselinesVector = createTextStorageOwnedGpuVector(device, `${id}-default-row-alignment-baselines`, makeNumericArrowVector(new import_apache_arrow.Uint32(), new Uint32Array([getAlignmentBaselineEnum(props.alignmentBaseline)])));
|
|
1428
|
+
const clipRectsVector = createTextStorageOwnedGpuVector(device, `${id}-default-row-clip-rects`, (0, import_arrow2.makeArrowFixedSizeListVector)(new import_apache_arrow.Float32(), 4, new Float32Array([0, 0, -1, -1])));
|
|
1429
|
+
return {
|
|
1430
|
+
colorsBuffer: getTextStorageGpuVectorBuffer(colorsVector),
|
|
1431
|
+
anglesBuffer: getTextStorageGpuVectorBuffer(anglesVector),
|
|
1432
|
+
sizesBuffer: getTextStorageGpuVectorBuffer(sizesVector),
|
|
1433
|
+
pixelOffsetsBuffer: getTextStorageGpuVectorBuffer(pixelOffsetsVector),
|
|
1434
|
+
textAnchorsBuffer: getTextStorageGpuVectorBuffer(textAnchorsVector),
|
|
1435
|
+
alignmentBaselinesBuffer: getTextStorageGpuVectorBuffer(alignmentBaselinesVector),
|
|
1436
|
+
clipRectsBuffer: getTextStorageGpuVectorBuffer(clipRectsVector),
|
|
1437
|
+
byteLength: Uint8Array.BYTES_PER_ELEMENT * 4 + Float32Array.BYTES_PER_ELEMENT + Float32Array.BYTES_PER_ELEMENT + Float32Array.BYTES_PER_ELEMENT * 2 + Uint32Array.BYTES_PER_ELEMENT + Uint32Array.BYTES_PER_ELEMENT + Float32Array.BYTES_PER_ELEMENT * 4,
|
|
1438
|
+
ownedResources: [
|
|
1439
|
+
colorsVector,
|
|
1440
|
+
anglesVector,
|
|
1441
|
+
sizesVector,
|
|
1442
|
+
pixelOffsetsVector,
|
|
1443
|
+
textAnchorsVector,
|
|
1444
|
+
alignmentBaselinesVector,
|
|
1445
|
+
clipRectsVector
|
|
1446
|
+
]
|
|
1447
|
+
};
|
|
1448
|
+
}
|
|
1449
|
+
function createTextStorageBatchRowState(device, props, batchInput, defaultBuffers, fontRenderSettings) {
|
|
1450
|
+
const packedClipRects = batchInput.clipRects ? packTextStorageClipRects(batchInput.clipRects) : void 0;
|
|
1451
|
+
const rowClipRectsVector = packedClipRects ? createTextStorageOwnedGpuVector(device, `${props.id || "text-storage-model"}-row-clip-rects-${batchInput.batchRowIndexBase}`, (0, import_arrow2.makeArrowFixedSizeListVector)(new import_apache_arrow.Float32(), 4, packedClipRects.byteLength > 0 ? packedClipRects : new Float32Array(4))) : void 0;
|
|
1452
|
+
const rowClipRectsBuffer = rowClipRectsVector ? getTextStorageGpuVectorBuffer(rowClipRectsVector) : batchInput.clipRectsBuffer ? getComputeTextStorageBuffer(batchInput.clipRectsBuffer) : defaultBuffers.clipRectsBuffer;
|
|
1453
|
+
const styleConfigData = createTextStorageStyleConfigData(props, batchInput.batchRowIndexBase, batchInput.rowStorageIndexBase, fontRenderSettings);
|
|
1454
|
+
const styleConfigBuffer = new import_dynamic.DynamicBuffer(device, {
|
|
1455
|
+
id: `${props.id || "text-storage-model"}-style-config-${batchInput.batchRowIndexBase}`,
|
|
1456
|
+
usage: import_core.Buffer.UNIFORM | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC,
|
|
1457
|
+
data: styleConfigData
|
|
1458
|
+
});
|
|
1459
|
+
const ownedResources = [styleConfigBuffer, ...rowClipRectsVector ? [rowClipRectsVector] : []];
|
|
1460
|
+
return {
|
|
1461
|
+
rowPositionsBuffer: batchInput.positionsBuffer,
|
|
1462
|
+
rowStorageIndexBase: batchInput.rowStorageIndexBase,
|
|
1463
|
+
rowColorsBuffer: batchInput.colorsBuffer ?? defaultBuffers.colorsBuffer,
|
|
1464
|
+
rowAnglesBuffer: batchInput.anglesBuffer ?? defaultBuffers.anglesBuffer,
|
|
1465
|
+
rowSizesBuffer: batchInput.sizesBuffer ?? defaultBuffers.sizesBuffer,
|
|
1466
|
+
rowPixelOffsetsBuffer: batchInput.pixelOffsetsBuffer ?? defaultBuffers.pixelOffsetsBuffer,
|
|
1467
|
+
rowTextAnchorsBuffer: batchInput.textAnchorsBuffer ?? defaultBuffers.textAnchorsBuffer,
|
|
1468
|
+
rowAlignmentBaselinesBuffer: batchInput.alignmentBaselinesBuffer ?? defaultBuffers.alignmentBaselinesBuffer,
|
|
1469
|
+
rowClipRectsBuffer,
|
|
1470
|
+
styleConfigBuffer,
|
|
1471
|
+
ownedResources,
|
|
1472
|
+
ownedByteLength: styleConfigData.byteLength + ((packedClipRects == null ? void 0 : packedClipRects.byteLength) ?? 0)
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
function createTextStorageOwnedGpuVector(device, name, vector) {
|
|
1476
|
+
return (0, import_arrow4.makeGPUVectorFromArrow)(device, vector, {
|
|
1477
|
+
name,
|
|
1478
|
+
id: name,
|
|
1479
|
+
usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1482
|
+
function getTextStorageGpuVectorBuffer(vector) {
|
|
1483
|
+
const [data, ...remainingData] = vector.data;
|
|
1484
|
+
if (!data || remainingData.length > 0) {
|
|
1485
|
+
throw new Error(`Storage text vector "${vector.name}" requires exactly one GPUData chunk`);
|
|
1486
|
+
}
|
|
1487
|
+
const buffer = data.buffer;
|
|
1488
|
+
return buffer instanceof import_dynamic.DynamicBuffer ? buffer.buffer : buffer;
|
|
1489
|
+
}
|
|
1490
|
+
function createTextDictionaryStorageBuffer(device, props, name, data, emptyData, usage = import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC) {
|
|
1491
|
+
return device.createBuffer({
|
|
1492
|
+
id: `${props.id || "arrow-text-dictionary-storage-model"}-${name}`,
|
|
1493
|
+
usage,
|
|
1494
|
+
data: data.byteLength > 0 ? data : emptyData
|
|
1495
|
+
});
|
|
1496
|
+
}
|
|
1497
|
+
function appendArrowTextStorageStateBatches(device, props, storageState) {
|
|
1498
|
+
const appendContext = storageState.arrowAppendContext;
|
|
1499
|
+
if (!appendContext) {
|
|
1500
|
+
throw new Error("ArrowTextStorageState requires append context");
|
|
1501
|
+
}
|
|
1502
|
+
const textInputs = resolveArrowTextStorageInputs(props);
|
|
1503
|
+
assertTextStorageAppendCompatible(storageState, textInputs.batches);
|
|
1504
|
+
if (textInputs.batches.length === storageState.batches.length) {
|
|
1505
|
+
return;
|
|
1506
|
+
}
|
|
1507
|
+
const hasGlyphRowIndices = storageState.hasGlyphRowIndices === true;
|
|
1508
|
+
const compactGlyphVertexByteStride = hasGlyphRowIndices ? import_text_experimental.ROW_INDEXED_COMPACT_GLYPH_VERTEX_BYTE_STRIDE : COMPACT_GLYPH_VERTEX_BYTE_STRIDE;
|
|
1509
|
+
for (let batchIndex = storageState.batches.length; batchIndex < textInputs.batches.length; batchIndex++) {
|
|
1510
|
+
const batchInput = textInputs.batches[batchIndex];
|
|
1511
|
+
const rowState = createTextStorageBatchRowState(device, props, batchInput, appendContext.defaultBuffers, appendContext.mappingState.fontRenderSettings);
|
|
1512
|
+
const rowBindingBatchIndex = storageState.batches.length;
|
|
1513
|
+
storageState.ownedRowBindingResources.push(...rowState.ownedResources);
|
|
1514
|
+
storageState.rowStorageByteLength += rowState.ownedByteLength;
|
|
1515
|
+
if (appendContext.useGpuUtf8Decode) {
|
|
1516
|
+
const glyphDefinitions = appendContext.utf8GlyphDefinitions;
|
|
1517
|
+
if (!glyphDefinitions) {
|
|
1518
|
+
throw new Error("TextStorageState is missing UTF-8 glyph definitions");
|
|
1519
|
+
}
|
|
1520
|
+
const utf8TextInput = (0, import_arrow_text.buildGpuUtf8TextInput)(batchInput.texts);
|
|
1521
|
+
const rowGlyphStarts = createStorageRowGlyphStartsBuffer(device, props, batchInput.batchRowIndexBase, utf8TextInput.startIndices);
|
|
1522
|
+
storageState.ownedGlyphResources.push(rowGlyphStarts.buffer);
|
|
1523
|
+
storageState.renderControlByteLength += rowGlyphStarts.byteLength;
|
|
1524
|
+
const glyphMetrics = (0, import_text_experimental.createTextStorageGlyphMetrics)(device, { id: props.id }, glyphDefinitions.glyphMetrics);
|
|
1525
|
+
const glyphLookup = (0, import_text_experimental.createTextStorageGlyphLookup)(device, { id: props.id }, glyphDefinitions.glyphLookup);
|
|
1526
|
+
const glyphPages = (0, import_text_experimental.createTextStorageGlyphPages)(device, { id: props.id }, glyphDefinitions.glyphPages);
|
|
1527
|
+
const glyphKernings = (0, import_text_experimental.createTextStorageGlyphKernings)(device, { id: props.id }, glyphDefinitions.glyphKernings);
|
|
1528
|
+
const generatedBufferBatches = (0, import_gpu_tables.planGeneratedBufferBatches)({
|
|
1529
|
+
device,
|
|
1530
|
+
recordOffsets: utf8TextInput.startIndices,
|
|
1531
|
+
recordByteStride: compactGlyphVertexByteStride,
|
|
1532
|
+
maxBatchByteLength: device.limits.maxStorageBufferBindingSize,
|
|
1533
|
+
resourceLabel: "ArrowTextStorageModel UTF-8 generated glyph vertex data"
|
|
1534
|
+
});
|
|
1535
|
+
for (const generatedBufferBatch of generatedBufferBatches) {
|
|
1536
|
+
const partitionedUtf8TextInput = createPartitionedGpuUtf8TextInput(utf8TextInput, generatedBufferBatch);
|
|
1537
|
+
const utf8Input = (0, import_text_experimental.createGpuUtf8ExpandedInput)(device, { id: props.id }, {
|
|
1538
|
+
utf8TextInput: partitionedUtf8TextInput,
|
|
1539
|
+
baselineOffsetY: glyphDefinitions.baselineOffsetY,
|
|
1540
|
+
glyphLookupCount: glyphDefinitions.glyphLookup.length / 2,
|
|
1541
|
+
labelCount: generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart,
|
|
1542
|
+
batchRowIndexBase: generatedBufferBatch.rowStart,
|
|
1543
|
+
rowStorageIndexBase: batchInput.rowStorageIndexBase + generatedBufferBatch.rowStart,
|
|
1544
|
+
alignment: createGpuTextAlignmentOptions(props, rowState, appendContext.mappingState.lineHeight)
|
|
1545
|
+
});
|
|
1546
|
+
const generated = (0, import_text_experimental.createGpuExpandedGeneratedState)(device, { id: props.id }, partitionedUtf8TextInput.byteLength, hasGlyphRowIndices);
|
|
1547
|
+
(0, import_text_experimental.dispatchGpuUtf8ExpandedTextCompute)(device, { id: props.id }, {
|
|
1548
|
+
utf8Input,
|
|
1549
|
+
glyphLookup,
|
|
1550
|
+
glyphMetrics,
|
|
1551
|
+
glyphPages,
|
|
1552
|
+
glyphKernings,
|
|
1553
|
+
generated,
|
|
1554
|
+
outputSlotCount: partitionedUtf8TextInput.byteLength,
|
|
1555
|
+
labelCount: generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart,
|
|
1556
|
+
alignment: {
|
|
1557
|
+
rowTextAnchorsBuffer: getComputeTextStorageBuffer(rowState.rowTextAnchorsBuffer),
|
|
1558
|
+
rowAlignmentBaselinesBuffer: getComputeTextStorageBuffer(rowState.rowAlignmentBaselinesBuffer)
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
const storageRenderConfigBuffer = createStorageRenderConfigBuffer(device, props, batchInput.batchRowIndexBase, generatedBufferBatch);
|
|
1562
|
+
storageState.renderBatches.push({
|
|
1563
|
+
rowBindingBatchIndex,
|
|
1564
|
+
rowStart: generatedBufferBatch.rowStart,
|
|
1565
|
+
rowEnd: generatedBufferBatch.rowEnd,
|
|
1566
|
+
glyphIndexBase: generatedBufferBatch.recordStart,
|
|
1567
|
+
glyphCount: partitionedUtf8TextInput.byteLength,
|
|
1568
|
+
compactGlyphVertexData: generated.compactGlyphVertexData,
|
|
1569
|
+
storageRenderConfigBuffer
|
|
1570
|
+
});
|
|
1571
|
+
storageState.ownedGlyphResources.push(storageRenderConfigBuffer);
|
|
1572
|
+
storageState.renderControlByteLength += storageRenderConfigBuffer.byteLength;
|
|
1573
|
+
storageState.generatedRenderBufferByteLength += generated.byteLength;
|
|
1574
|
+
storageState.transientComputeInputByteLength += utf8Input.byteLength;
|
|
1575
|
+
utf8Input.rowByteRangesBuffer.destroy();
|
|
1576
|
+
utf8Input.utf8BytesBuffer.destroy();
|
|
1577
|
+
utf8Input.expansionConfigBuffer.destroy();
|
|
1578
|
+
}
|
|
1579
|
+
storageState.batches.push({
|
|
1580
|
+
...rowState,
|
|
1581
|
+
batchRowIndexBase: batchInput.batchRowIndexBase,
|
|
1582
|
+
rowCount: batchInput.texts.length,
|
|
1583
|
+
glyphCount: utf8TextInput.byteLength,
|
|
1584
|
+
rowGlyphStartsBuffer: rowGlyphStarts.buffer
|
|
1585
|
+
});
|
|
1586
|
+
storageState.glyphCount += utf8TextInput.byteLength;
|
|
1587
|
+
storageState.glyphAttributeBuildTimeMs += utf8TextInput.textInputBuildTimeMs;
|
|
1588
|
+
storageState.compactStreamBuildTimeMs = storageState.glyphAttributeBuildTimeMs;
|
|
1589
|
+
storageState.compactStreamByteLength += utf8TextInput.inputByteLength;
|
|
1590
|
+
storageState.transientComputeInputByteLength += glyphLookup.byteLength + glyphMetrics.byteLength + glyphPages.byteLength + glyphKernings.byteLength;
|
|
1591
|
+
glyphMetrics.buffer.destroy();
|
|
1592
|
+
glyphLookup.buffer.destroy();
|
|
1593
|
+
glyphPages.buffer.destroy();
|
|
1594
|
+
glyphKernings.buffer.destroy();
|
|
1595
|
+
} else {
|
|
1596
|
+
const batchGlyphStream = (0, import_arrow_text.buildGpuExpandedTextStream)({
|
|
1597
|
+
texts: batchInput.texts,
|
|
1598
|
+
fontAtlas: appendContext.mappingState.fontAtlas,
|
|
1599
|
+
lineHeight: appendContext.mappingState.lineHeight,
|
|
1600
|
+
characterSet: appendContext.mappingState.characterSet
|
|
1601
|
+
});
|
|
1602
|
+
const rowGlyphStarts = createStorageRowGlyphStartsBuffer(device, props, batchInput.batchRowIndexBase, batchGlyphStream.startIndices);
|
|
1603
|
+
storageState.ownedGlyphResources.push(rowGlyphStarts.buffer);
|
|
1604
|
+
storageState.renderControlByteLength += rowGlyphStarts.byteLength;
|
|
1605
|
+
const glyphMetrics = (0, import_text_experimental.createTextStorageGlyphMetrics)(device, { id: props.id }, batchGlyphStream.glyphMetrics);
|
|
1606
|
+
const glyphPages = (0, import_text_experimental.createTextStorageGlyphPages)(device, { id: props.id }, batchGlyphStream.glyphPages);
|
|
1607
|
+
const glyphKernings = (0, import_text_experimental.createTextStorageGlyphKernings)(device, { id: props.id }, batchGlyphStream.glyphKernings);
|
|
1608
|
+
const generatedBufferBatches = (0, import_gpu_tables.planGeneratedBufferBatches)({
|
|
1609
|
+
device,
|
|
1610
|
+
recordOffsets: batchGlyphStream.startIndices,
|
|
1611
|
+
recordByteStride: compactGlyphVertexByteStride,
|
|
1612
|
+
maxBatchByteLength: device.limits.maxStorageBufferBindingSize,
|
|
1613
|
+
resourceLabel: "ArrowTextStorageModel compact generated glyph vertex data"
|
|
1614
|
+
});
|
|
1615
|
+
for (const generatedBufferBatch of generatedBufferBatches) {
|
|
1616
|
+
const partitionedGlyphStream = createPartitionedGpuExpandedTextStream(batchGlyphStream, generatedBufferBatch);
|
|
1617
|
+
const compactInput = (0, import_text_experimental.createGpuExpandedCompactInput)(device, { id: props.id }, partitionedGlyphStream, generatedBufferBatch.rowStart, createGpuTextAlignmentOptions(props, rowState, appendContext.mappingState.lineHeight), batchInput.rowStorageIndexBase + generatedBufferBatch.rowStart);
|
|
1618
|
+
const generated = (0, import_text_experimental.createGpuExpandedGeneratedState)(device, { id: props.id }, partitionedGlyphStream.glyphCount, hasGlyphRowIndices);
|
|
1619
|
+
(0, import_text_experimental.dispatchGpuExpandedTextCompute)(device, { id: props.id }, {
|
|
1620
|
+
compactInput,
|
|
1621
|
+
glyphMetrics,
|
|
1622
|
+
glyphPages,
|
|
1623
|
+
glyphKernings,
|
|
1624
|
+
generated,
|
|
1625
|
+
glyphCount: partitionedGlyphStream.glyphCount,
|
|
1626
|
+
labelCount: generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart,
|
|
1627
|
+
alignment: {
|
|
1628
|
+
rowTextAnchorsBuffer: getComputeTextStorageBuffer(rowState.rowTextAnchorsBuffer),
|
|
1629
|
+
rowAlignmentBaselinesBuffer: getComputeTextStorageBuffer(rowState.rowAlignmentBaselinesBuffer),
|
|
1630
|
+
useRowTextAnchors: Boolean(props.textAnchors),
|
|
1631
|
+
useRowAlignmentBaselines: Boolean(props.alignmentBaselines)
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
const storageRenderConfigBuffer = createStorageRenderConfigBuffer(device, props, batchInput.batchRowIndexBase, generatedBufferBatch);
|
|
1635
|
+
storageState.renderBatches.push({
|
|
1636
|
+
rowBindingBatchIndex,
|
|
1637
|
+
rowStart: generatedBufferBatch.rowStart,
|
|
1638
|
+
rowEnd: generatedBufferBatch.rowEnd,
|
|
1639
|
+
glyphIndexBase: generatedBufferBatch.recordStart,
|
|
1640
|
+
glyphCount: partitionedGlyphStream.glyphCount,
|
|
1641
|
+
compactGlyphVertexData: generated.compactGlyphVertexData,
|
|
1642
|
+
storageRenderConfigBuffer
|
|
1643
|
+
});
|
|
1644
|
+
storageState.ownedGlyphResources.push(storageRenderConfigBuffer);
|
|
1645
|
+
storageState.renderControlByteLength += storageRenderConfigBuffer.byteLength;
|
|
1646
|
+
storageState.generatedRenderBufferByteLength += generated.byteLength;
|
|
1647
|
+
storageState.transientComputeInputByteLength += compactInput.byteLength;
|
|
1648
|
+
compactInput.glyphRangesBuffer.destroy();
|
|
1649
|
+
compactInput.glyphIdsBuffer.destroy();
|
|
1650
|
+
compactInput.expansionConfigBuffer.destroy();
|
|
1651
|
+
}
|
|
1652
|
+
storageState.batches.push({
|
|
1653
|
+
...rowState,
|
|
1654
|
+
batchRowIndexBase: batchInput.batchRowIndexBase,
|
|
1655
|
+
rowCount: batchInput.texts.length,
|
|
1656
|
+
glyphCount: batchGlyphStream.glyphCount,
|
|
1657
|
+
rowGlyphStartsBuffer: rowGlyphStarts.buffer
|
|
1658
|
+
});
|
|
1659
|
+
storageState.glyphCount += batchGlyphStream.glyphCount;
|
|
1660
|
+
storageState.glyphAttributeBuildTimeMs += batchGlyphStream.glyphStreamBuildTimeMs;
|
|
1661
|
+
storageState.compactStreamBuildTimeMs = storageState.glyphAttributeBuildTimeMs;
|
|
1662
|
+
storageState.compactStreamByteLength += batchGlyphStream.compactStreamByteLength;
|
|
1663
|
+
storageState.transientComputeInputByteLength += glyphMetrics.byteLength + glyphPages.byteLength + glyphKernings.byteLength;
|
|
1664
|
+
glyphMetrics.buffer.destroy();
|
|
1665
|
+
glyphPages.buffer.destroy();
|
|
1666
|
+
glyphKernings.buffer.destroy();
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
storageState.glyphAttributeByteLength = storageState.generatedRenderBufferByteLength + storageState.renderControlByteLength;
|
|
1670
|
+
}
|
|
1671
|
+
function assertTextStorageAppendCompatible(storageState, batches) {
|
|
1672
|
+
if (batches.length < storageState.batches.length) {
|
|
1673
|
+
throw new Error("ArrowTextStorageModel appended text batches cannot remove existing batches");
|
|
1674
|
+
}
|
|
1675
|
+
for (const [batchIndex, existingBatch] of storageState.batches.entries()) {
|
|
1676
|
+
const batchInput = batches[batchIndex];
|
|
1677
|
+
if (!batchInput || batchInput.batchRowIndexBase !== existingBatch.batchRowIndexBase || batchInput.rowStorageIndexBase !== existingBatch.rowStorageIndexBase || batchInput.texts.length !== existingBatch.rowCount || batchInput.positionsBuffer !== existingBatch.rowPositionsBuffer) {
|
|
1678
|
+
throw new Error("ArrowTextStorageModel appended text batches require existing row batches to stay unchanged");
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
function refreshArrowTextStorageRowBindings(device, props, storageState) {
|
|
1683
|
+
const textInputs = resolveArrowTextStorageInputs(props);
|
|
1684
|
+
assertTextStorageRowBindingRefreshCompatible(storageState, textInputs.batches);
|
|
1685
|
+
const nextOwnedRowBindingResources = [];
|
|
1686
|
+
const defaultBuffers = createTextStorageDefaultBuffers(device, props);
|
|
1687
|
+
nextOwnedRowBindingResources.push(...defaultBuffers.ownedResources);
|
|
1688
|
+
let rowStorageByteLength = defaultBuffers.byteLength;
|
|
1689
|
+
let nextBatches = [];
|
|
1690
|
+
try {
|
|
1691
|
+
nextBatches = textInputs.batches.map((batchInput, batchIndex) => {
|
|
1692
|
+
const previousBatch = storageState.batches[batchIndex];
|
|
1693
|
+
const rowState = createTextStorageBatchRowState(device, props, batchInput, defaultBuffers, storageState.fontRenderSettings);
|
|
1694
|
+
nextOwnedRowBindingResources.push(...rowState.ownedResources);
|
|
1695
|
+
rowStorageByteLength += rowState.ownedByteLength;
|
|
1696
|
+
return {
|
|
1697
|
+
...rowState,
|
|
1698
|
+
batchRowIndexBase: previousBatch.batchRowIndexBase,
|
|
1699
|
+
rowStorageIndexBase: batchInput.rowStorageIndexBase,
|
|
1700
|
+
rowCount: previousBatch.rowCount,
|
|
1701
|
+
glyphCount: previousBatch.glyphCount,
|
|
1702
|
+
rowGlyphStartsBuffer: previousBatch.rowGlyphStartsBuffer
|
|
1703
|
+
};
|
|
1704
|
+
});
|
|
1705
|
+
} catch (error) {
|
|
1706
|
+
destroyTextStorageResources(nextOwnedRowBindingResources);
|
|
1707
|
+
throw error;
|
|
1708
|
+
}
|
|
1709
|
+
replaceOwnedTextStorageResources(storageState.ownedRowBindingResources, nextOwnedRowBindingResources);
|
|
1710
|
+
storageState.batches = nextBatches;
|
|
1711
|
+
storageState.rowStorageByteLength = rowStorageByteLength;
|
|
1712
|
+
const appendContext = getArrowTextStorageAppendContext(storageState);
|
|
1713
|
+
if (appendContext) {
|
|
1714
|
+
appendContext.defaultBuffers = defaultBuffers;
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
function assertTextStorageRowBindingRefreshCompatible(storageState, batches) {
|
|
1718
|
+
if (batches.length !== storageState.batches.length) {
|
|
1719
|
+
throw new Error("ArrowTextStorageModel row-binding updates must preserve text batch count");
|
|
1720
|
+
}
|
|
1721
|
+
for (const [batchIndex, batchInput] of batches.entries()) {
|
|
1722
|
+
const existingBatch = storageState.batches[batchIndex];
|
|
1723
|
+
if (!existingBatch || existingBatch.batchRowIndexBase !== batchInput.batchRowIndexBase || existingBatch.rowCount !== batchInput.texts.length) {
|
|
1724
|
+
throw new Error("ArrowTextStorageModel row-binding updates must preserve text batch rows");
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
function getArrowTextStorageAppendContext(storageState) {
|
|
1729
|
+
return isArrowTextStorageState(storageState) ? storageState.arrowAppendContext : void 0;
|
|
1730
|
+
}
|
|
1731
|
+
function isArrowTextStorageState(storageState) {
|
|
1732
|
+
return "arrowAppendContext" in storageState;
|
|
1733
|
+
}
|
|
1734
|
+
function refreshArrowTextDictionaryStorageRowBindings(device, props, storageState) {
|
|
1735
|
+
const textInputs = resolveArrowTextDictionaryStorageInputs(props);
|
|
1736
|
+
assertTextDictionaryStorageRowBindingRefreshCompatible(storageState, textInputs.batches);
|
|
1737
|
+
const nextOwnedRowBindingResources = [];
|
|
1738
|
+
const defaultBuffers = createTextStorageDefaultBuffers(device, props);
|
|
1739
|
+
nextOwnedRowBindingResources.push(...defaultBuffers.ownedResources);
|
|
1740
|
+
let rowStorageByteLength = defaultBuffers.byteLength;
|
|
1741
|
+
let nextBatches = [];
|
|
1742
|
+
try {
|
|
1743
|
+
nextBatches = textInputs.batches.map((batchInput, batchIndex) => {
|
|
1744
|
+
const previousBatch = storageState.batches[batchIndex];
|
|
1745
|
+
const rowState = createTextStorageBatchRowState(device, props, batchInput, defaultBuffers, storageState.fontRenderSettings);
|
|
1746
|
+
nextOwnedRowBindingResources.push(...rowState.ownedResources);
|
|
1747
|
+
rowStorageByteLength += rowState.ownedByteLength;
|
|
1748
|
+
return {
|
|
1749
|
+
...rowState,
|
|
1750
|
+
batchRowIndexBase: previousBatch.batchRowIndexBase,
|
|
1751
|
+
rowStorageIndexBase: batchInput.rowStorageIndexBase,
|
|
1752
|
+
rowCount: previousBatch.rowCount,
|
|
1753
|
+
glyphCount: previousBatch.glyphCount,
|
|
1754
|
+
rowDictionaryRecordsBuffer: previousBatch.rowDictionaryRecordsBuffer,
|
|
1755
|
+
dictionaryGlyphRangesBuffer: previousBatch.dictionaryGlyphRangesBuffer,
|
|
1756
|
+
dictionaryGlyphRecordsBuffer: previousBatch.dictionaryGlyphRecordsBuffer,
|
|
1757
|
+
glyphFramesBuffer: previousBatch.glyphFramesBuffer,
|
|
1758
|
+
dictionaryGlyphCount: previousBatch.dictionaryGlyphCount,
|
|
1759
|
+
dictionaryValueCount: previousBatch.dictionaryValueCount
|
|
1760
|
+
};
|
|
1761
|
+
});
|
|
1762
|
+
} catch (error) {
|
|
1763
|
+
destroyTextStorageResources(nextOwnedRowBindingResources);
|
|
1764
|
+
throw error;
|
|
1765
|
+
}
|
|
1766
|
+
replaceOwnedTextStorageResources(storageState.ownedRowBindingResources, nextOwnedRowBindingResources);
|
|
1767
|
+
storageState.batches = nextBatches;
|
|
1768
|
+
storageState.rowStorageByteLength = rowStorageByteLength;
|
|
1769
|
+
}
|
|
1770
|
+
function assertTextDictionaryStorageRowBindingRefreshCompatible(storageState, batches) {
|
|
1771
|
+
if (batches.length !== storageState.batches.length) {
|
|
1772
|
+
throw new Error("ArrowTextDictionaryStorageModel row-binding updates must preserve text batch count");
|
|
1773
|
+
}
|
|
1774
|
+
for (const [batchIndex, batchInput] of batches.entries()) {
|
|
1775
|
+
const existingBatch = storageState.batches[batchIndex];
|
|
1776
|
+
if (!existingBatch || existingBatch.batchRowIndexBase !== batchInput.batchRowIndexBase || existingBatch.rowStorageIndexBase !== batchInput.rowStorageIndexBase || existingBatch.rowCount !== batchInput.texts.length) {
|
|
1777
|
+
throw new Error("ArrowTextDictionaryStorageModel row-binding updates must preserve text batch rows");
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
function destroyTextStorageResources(resources) {
|
|
1782
|
+
for (const resource of resources) {
|
|
1783
|
+
resource.destroy();
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
function replaceOwnedTextStorageResources(currentResources, nextResources) {
|
|
1787
|
+
destroyTextStorageResources(currentResources);
|
|
1788
|
+
currentResources.splice(0, currentResources.length, ...nextResources);
|
|
1789
|
+
}
|
|
1790
|
+
function createTextStorageStyleConfigData(props, batchRowIndexBase, rowStorageIndexBase, fontRenderSettings) {
|
|
1791
|
+
const arrayBuffer = new ArrayBuffer(80);
|
|
1792
|
+
const floatValues = new Float32Array(arrayBuffer);
|
|
1793
|
+
const uintValues = new Uint32Array(arrayBuffer);
|
|
1794
|
+
const color = props.color ?? DEFAULT_TEXT_STORAGE_COLOR;
|
|
1795
|
+
floatValues[0] = color[0] / 255;
|
|
1796
|
+
floatValues[1] = color[1] / 255;
|
|
1797
|
+
floatValues[2] = color[2] / 255;
|
|
1798
|
+
floatValues[3] = color[3] / 255;
|
|
1799
|
+
floatValues[4] = props.angle ?? DEFAULT_TEXT_STORAGE_ANGLE;
|
|
1800
|
+
floatValues[5] = props.size ?? DEFAULT_TEXT_STORAGE_SIZE;
|
|
1801
|
+
floatValues[6] = (props.pixelOffset ?? DEFAULT_TEXT_STORAGE_PIXEL_OFFSET)[0];
|
|
1802
|
+
floatValues[7] = (props.pixelOffset ?? DEFAULT_TEXT_STORAGE_PIXEL_OFFSET)[1];
|
|
1803
|
+
uintValues[8] = props.colors ? 1 : 0;
|
|
1804
|
+
uintValues[9] = props.angles ? 1 : 0;
|
|
1805
|
+
uintValues[10] = props.sizes ? 1 : 0;
|
|
1806
|
+
uintValues[11] = props.pixelOffsets ? 1 : 0;
|
|
1807
|
+
uintValues[12] = props.clipRects ? 1 : 0;
|
|
1808
|
+
uintValues[13] = batchRowIndexBase;
|
|
1809
|
+
uintValues[14] = rowStorageIndexBase;
|
|
1810
|
+
uintValues[15] = 0;
|
|
1811
|
+
floatValues[16] = fontRenderSettings.mode === "bitmap" ? BITMAP_TEXT_SDF_THRESHOLD : fontRenderSettings.threshold;
|
|
1812
|
+
floatValues[17] = fontRenderSettings.smoothing;
|
|
1813
|
+
uintValues[18] = fontRenderSettings.mode === "bitmap" ? 0 : fontRenderSettings.mode === "sdf" ? 1 : 2;
|
|
1814
|
+
floatValues[19] = fontRenderSettings.distanceRange ?? 0;
|
|
1815
|
+
return uintValues;
|
|
1816
|
+
}
|
|
1817
|
+
function createGpuTextAlignmentOptions(props, rowState, lineHeight) {
|
|
1818
|
+
return {
|
|
1819
|
+
rowTextAnchorsBuffer: getComputeTextStorageBuffer(rowState.rowTextAnchorsBuffer),
|
|
1820
|
+
rowAlignmentBaselinesBuffer: getComputeTextStorageBuffer(rowState.rowAlignmentBaselinesBuffer),
|
|
1821
|
+
useRowTextAnchors: Boolean(props.textAnchors),
|
|
1822
|
+
useRowAlignmentBaselines: Boolean(props.alignmentBaselines),
|
|
1823
|
+
textAnchor: getTextAnchorEnum(props.textAnchor),
|
|
1824
|
+
alignmentBaseline: getAlignmentBaselineEnum(props.alignmentBaseline),
|
|
1825
|
+
lineHeight
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
function getComputeTextStorageBuffer(buffer) {
|
|
1829
|
+
return buffer instanceof import_dynamic.DynamicBuffer ? buffer.buffer : buffer;
|
|
1830
|
+
}
|
|
1831
|
+
function createTextStorageGlyphFrames(device, props, glyphFrameData) {
|
|
1832
|
+
return {
|
|
1833
|
+
buffer: device.createBuffer({
|
|
1834
|
+
id: `${props.id || "arrow-text-storage-model"}-glyph-frames`,
|
|
1835
|
+
usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC,
|
|
1836
|
+
data: glyphFrameData.byteLength > 0 ? glyphFrameData : new Float32Array(4)
|
|
1837
|
+
}),
|
|
1838
|
+
byteLength: glyphFrameData.byteLength
|
|
1839
|
+
};
|
|
1840
|
+
}
|
|
1841
|
+
function getTextAtlasTexture(device, props, fontAtlas) {
|
|
1842
|
+
if (props.resources) {
|
|
1843
|
+
return { atlasTexture: props.resources.atlasTexture, ownsAtlasTexture: false };
|
|
1844
|
+
}
|
|
1845
|
+
return {
|
|
1846
|
+
atlasTexture: new import_dynamic.DynamicTexture(device, {
|
|
1847
|
+
id: `${props.id || "text-model"}-atlas`,
|
|
1848
|
+
dimension: "2d-array",
|
|
1849
|
+
data: [...fontAtlas.pages]
|
|
1850
|
+
}),
|
|
1851
|
+
ownsAtlasTexture: true
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
function packTextStorageClipRects(clipRects) {
|
|
1855
|
+
assertClipRects(clipRects, clipRects.length);
|
|
1856
|
+
return new Float32Array((0, import_arrow2.getArrowVectorBufferSource)(clipRects));
|
|
1857
|
+
}
|
|
1858
|
+
function getTextAnchorEnum(textAnchor) {
|
|
1859
|
+
switch (textAnchor) {
|
|
1860
|
+
case "middle":
|
|
1861
|
+
return 1;
|
|
1862
|
+
case "end":
|
|
1863
|
+
return 2;
|
|
1864
|
+
case "start":
|
|
1865
|
+
default:
|
|
1866
|
+
return DEFAULT_TEXT_STORAGE_ANCHOR;
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
function getAlignmentBaselineEnum(alignmentBaseline) {
|
|
1870
|
+
switch (alignmentBaseline) {
|
|
1871
|
+
case "top":
|
|
1872
|
+
return 1;
|
|
1873
|
+
case "bottom":
|
|
1874
|
+
return 2;
|
|
1875
|
+
case "center":
|
|
1876
|
+
default:
|
|
1877
|
+
return DEFAULT_STORAGE_ALIGNMENT_BASELINE;
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
function createPartitionedGpuExpandedTextStream(glyphStream, generatedBufferBatch) {
|
|
1881
|
+
const rowCount = generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart;
|
|
1882
|
+
const startIndices = new Array(rowCount + 1);
|
|
1883
|
+
const labelGlyphRanges = new Uint32Array(rowCount * 2);
|
|
1884
|
+
startIndices[0] = 0;
|
|
1885
|
+
for (let localRowIndex = 0; localRowIndex < rowCount; localRowIndex++) {
|
|
1886
|
+
const sourceRowIndex = generatedBufferBatch.rowStart + localRowIndex;
|
|
1887
|
+
const sourceGlyphStart = glyphStream.startIndices[sourceRowIndex] ?? generatedBufferBatch.recordStart;
|
|
1888
|
+
const sourceGlyphEnd = glyphStream.startIndices[sourceRowIndex + 1] ?? generatedBufferBatch.recordStart;
|
|
1889
|
+
const localGlyphStart = sourceGlyphStart - generatedBufferBatch.recordStart;
|
|
1890
|
+
const localGlyphEnd = sourceGlyphEnd - generatedBufferBatch.recordStart;
|
|
1891
|
+
labelGlyphRanges[localRowIndex * 2] = localGlyphStart;
|
|
1892
|
+
labelGlyphRanges[localRowIndex * 2 + 1] = localGlyphEnd;
|
|
1893
|
+
startIndices[localRowIndex + 1] = localGlyphEnd;
|
|
1894
|
+
}
|
|
1895
|
+
const packedGlyphIds = copyPackedUint16Range(glyphStream.packedGlyphIds, generatedBufferBatch.recordStart, generatedBufferBatch.recordEnd);
|
|
1896
|
+
return {
|
|
1897
|
+
...glyphStream,
|
|
1898
|
+
startIndices,
|
|
1899
|
+
glyphCount: generatedBufferBatch.recordCount,
|
|
1900
|
+
labelGlyphRanges,
|
|
1901
|
+
packedGlyphIds,
|
|
1902
|
+
compactStreamByteLength: labelGlyphRanges.byteLength + packedGlyphIds.byteLength,
|
|
1903
|
+
glyphStreamBuildTimeMs: 0
|
|
1904
|
+
};
|
|
1905
|
+
}
|
|
1906
|
+
function createPartitionedGpuUtf8TextInput(utf8TextInput, generatedBufferBatch) {
|
|
1907
|
+
const rowCount = generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart;
|
|
1908
|
+
const rowByteRanges = new Uint32Array(rowCount * 2);
|
|
1909
|
+
const startIndices = new Array(rowCount + 1);
|
|
1910
|
+
startIndices[0] = 0;
|
|
1911
|
+
for (let localRowIndex = 0; localRowIndex < rowCount; localRowIndex++) {
|
|
1912
|
+
const sourceRowIndex = generatedBufferBatch.rowStart + localRowIndex;
|
|
1913
|
+
const sourceByteStart = utf8TextInput.rowByteRanges[sourceRowIndex * 2] ?? 0;
|
|
1914
|
+
const sourceByteEnd = utf8TextInput.rowByteRanges[sourceRowIndex * 2 + 1] ?? sourceByteStart;
|
|
1915
|
+
const hasPartitionLocalBytes = sourceByteEnd > sourceByteStart && sourceByteStart >= generatedBufferBatch.recordStart && sourceByteEnd <= generatedBufferBatch.recordEnd;
|
|
1916
|
+
const localByteStart = hasPartitionLocalBytes ? sourceByteStart - generatedBufferBatch.recordStart : 0;
|
|
1917
|
+
const localByteEnd = hasPartitionLocalBytes ? sourceByteEnd - generatedBufferBatch.recordStart : localByteStart;
|
|
1918
|
+
rowByteRanges[localRowIndex * 2] = localByteStart;
|
|
1919
|
+
rowByteRanges[localRowIndex * 2 + 1] = localByteEnd;
|
|
1920
|
+
startIndices[localRowIndex + 1] = Math.max(startIndices[localRowIndex] ?? 0, localByteEnd);
|
|
1921
|
+
}
|
|
1922
|
+
const packedUtf8Bytes = copyPackedByteRange(utf8TextInput.packedUtf8Bytes, generatedBufferBatch.recordStart, generatedBufferBatch.recordEnd);
|
|
1923
|
+
return {
|
|
1924
|
+
startIndices,
|
|
1925
|
+
rowByteRanges,
|
|
1926
|
+
packedUtf8Bytes,
|
|
1927
|
+
byteLength: generatedBufferBatch.recordCount,
|
|
1928
|
+
inputByteLength: rowByteRanges.byteLength + packedUtf8Bytes.byteLength,
|
|
1929
|
+
textInputBuildTimeMs: 0
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
function createPartitionedGpuVectorUtf8TextInput(device, props, textBatch, generatedBufferBatch) {
|
|
1933
|
+
const usesFullBatch = generatedBufferBatch.rowStart === 0 && generatedBufferBatch.rowEnd === textBatch.rowCount && generatedBufferBatch.recordStart === 0 && generatedBufferBatch.recordEnd === textBatch.byteLength;
|
|
1934
|
+
if (usesFullBatch) {
|
|
1935
|
+
return {
|
|
1936
|
+
rowByteRangesBuffer: textBatch.rowByteRangesBuffer,
|
|
1937
|
+
inputByteLength: textBatch.inputByteLength,
|
|
1938
|
+
ownsRowByteRangesBuffer: false
|
|
1939
|
+
};
|
|
1940
|
+
}
|
|
1941
|
+
const rowCount = generatedBufferBatch.rowEnd - generatedBufferBatch.rowStart;
|
|
1942
|
+
const rowByteRanges = new Uint32Array(rowCount * 2);
|
|
1943
|
+
for (let localRowIndex = 0; localRowIndex < rowCount; localRowIndex++) {
|
|
1944
|
+
const sourceRowIndex = generatedBufferBatch.rowStart + localRowIndex;
|
|
1945
|
+
rowByteRanges[localRowIndex * 2] = textBatch.rowByteRanges[sourceRowIndex * 2] ?? 0;
|
|
1946
|
+
rowByteRanges[localRowIndex * 2 + 1] = textBatch.rowByteRanges[sourceRowIndex * 2 + 1] ?? rowByteRanges[localRowIndex * 2];
|
|
1947
|
+
}
|
|
1948
|
+
return {
|
|
1949
|
+
rowByteRangesBuffer: device.createBuffer({
|
|
1950
|
+
id: `${props.id || "text-storage-model"}-utf8-row-byte-ranges-${generatedBufferBatch.rowStart}`,
|
|
1951
|
+
usage: import_core.Buffer.STORAGE | import_core.Buffer.COPY_DST | import_core.Buffer.COPY_SRC,
|
|
1952
|
+
data: rowByteRanges.byteLength > 0 ? rowByteRanges : new Uint32Array(2)
|
|
1953
|
+
}),
|
|
1954
|
+
inputByteLength: rowByteRanges.byteLength + generatedBufferBatch.recordCount,
|
|
1955
|
+
ownsRowByteRangesBuffer: true
|
|
1956
|
+
};
|
|
1957
|
+
}
|
|
1958
|
+
function copyPackedUint16Range(source, startIndex, endIndex) {
|
|
1959
|
+
const valueCount = Math.max(0, endIndex - startIndex);
|
|
1960
|
+
const target = new Uint32Array(Math.ceil(valueCount / 2));
|
|
1961
|
+
for (let localIndex = 0; localIndex < valueCount; localIndex++) {
|
|
1962
|
+
const value = readPackedUint16(source, startIndex + localIndex);
|
|
1963
|
+
writePackedUint16(target, localIndex, value);
|
|
1964
|
+
}
|
|
1965
|
+
return target;
|
|
1966
|
+
}
|
|
1967
|
+
function readPackedUint16(source, index) {
|
|
1968
|
+
const word = source[index >> 1] ?? 0;
|
|
1969
|
+
return index & 1 ? word >>> 16 : word & 65535;
|
|
1970
|
+
}
|
|
1971
|
+
function writePackedUint16(target, index, value) {
|
|
1972
|
+
const wordIndex = index >> 1;
|
|
1973
|
+
const word = target[wordIndex] ?? 0;
|
|
1974
|
+
target[wordIndex] = index & 1 ? word | (value & 65535) << 16 : word | value & 65535;
|
|
1975
|
+
}
|
|
1976
|
+
function copyPackedByteRange(source, startByteIndex, endByteIndex) {
|
|
1977
|
+
const byteLength = Math.max(0, endByteIndex - startByteIndex);
|
|
1978
|
+
const target = new Uint32Array(Math.ceil(byteLength / Uint32Array.BYTES_PER_ELEMENT));
|
|
1979
|
+
const sourceBytes = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
1980
|
+
new Uint8Array(target.buffer).set(sourceBytes.subarray(startByteIndex, endByteIndex));
|
|
1981
|
+
return target;
|
|
1982
|
+
}
|
|
1983
|
+
function makeFixedSizeListField(name, childType, listSize) {
|
|
1984
|
+
return new import_apache_arrow.Field(name, new import_apache_arrow.FixedSizeList(listSize, new import_apache_arrow.Field("value", childType, false)), false);
|
|
1985
|
+
}
|
|
1986
|
+
function isInstanceCompatibleArrowType(type) {
|
|
1987
|
+
return (0, import_arrow6.isNumericArrowType)(type) || import_apache_arrow.DataType.isFixedSizeList(type) && (0, import_arrow6.isNumericArrowType)(type.children[0].type);
|
|
1988
|
+
}
|
|
1989
|
+
function isArrowTextRowColorType(type) {
|
|
1990
|
+
var _a;
|
|
1991
|
+
return Boolean(type) && import_apache_arrow.DataType.isFixedSizeList(type) && type.listSize === 4 && ((_a = type.children[0]) == null ? void 0 : _a.type) instanceof import_apache_arrow.Uint8;
|
|
1992
|
+
}
|
|
1993
|
+
function isArrowTextCharacterColorType(type) {
|
|
1994
|
+
var _a;
|
|
1995
|
+
return Boolean(type) && import_apache_arrow.DataType.isList(type) && isArrowTextRowColorType((_a = type.children[0]) == null ? void 0 : _a.type);
|
|
1996
|
+
}
|
|
1997
|
+
function isArrowTextColorType(type) {
|
|
1998
|
+
return isArrowTextRowColorType(type) || isArrowTextCharacterColorType(type);
|
|
1999
|
+
}
|
|
2000
|
+
function expandArrowTextCharacterColorRows(vector, startIndices, nullValue) {
|
|
2001
|
+
const glyphCount = startIndices[startIndices.length - 1] ?? 0;
|
|
2002
|
+
const expandedValues = new Uint8Array(glyphCount * 4);
|
|
2003
|
+
let rowIndexBase = 0;
|
|
2004
|
+
for (const data of vector.data) {
|
|
2005
|
+
const valueOffsets = data.valueOffsets;
|
|
2006
|
+
const elementData = data.children[0];
|
|
2007
|
+
const valueData = elementData == null ? void 0 : elementData.children[0];
|
|
2008
|
+
const values = valueData == null ? void 0 : valueData.values;
|
|
2009
|
+
if (!valueOffsets || !elementData || !valueData || !values) {
|
|
2010
|
+
throw new Error("ArrowTextModel character colors require Arrow list offsets and values");
|
|
2011
|
+
}
|
|
2012
|
+
if (nullValue && ((elementData.nullCount ?? 0) > 0 || (valueData.nullCount ?? 0) > 0)) {
|
|
2013
|
+
throw new Error("ArrowTextModel character colors do not support nullable nested color values");
|
|
2014
|
+
}
|
|
2015
|
+
const firstElementOffset = valueOffsets[0] ?? 0;
|
|
2016
|
+
const valueOffset = valueData.offset ?? 0;
|
|
2017
|
+
for (let localRowIndex = 0; localRowIndex < data.length; localRowIndex++) {
|
|
2018
|
+
const rowIndex = rowIndexBase + localRowIndex;
|
|
2019
|
+
const glyphStart = startIndices[rowIndex] ?? 0;
|
|
2020
|
+
const glyphEnd = startIndices[rowIndex + 1] ?? glyphStart;
|
|
2021
|
+
const glyphRowLength = glyphEnd - glyphStart;
|
|
2022
|
+
if (nullValue && !isArrowDataRowValid(data, localRowIndex)) {
|
|
2023
|
+
for (let glyphIndex = glyphStart; glyphIndex < glyphEnd; glyphIndex++) {
|
|
2024
|
+
expandedValues.set(nullValue, glyphIndex * 4);
|
|
2025
|
+
}
|
|
2026
|
+
continue;
|
|
2027
|
+
}
|
|
2028
|
+
const colorStart = (valueOffsets[localRowIndex] ?? firstElementOffset) - firstElementOffset;
|
|
2029
|
+
const colorEnd = (valueOffsets[localRowIndex + 1] ?? colorStart) - firstElementOffset;
|
|
2030
|
+
if (colorEnd - colorStart !== glyphRowLength) {
|
|
2031
|
+
throw new Error("ArrowTextModel character colors must provide one color per UTF-8 code point");
|
|
2032
|
+
}
|
|
2033
|
+
expandedValues.set(values.subarray(valueOffset + colorStart * 4, valueOffset + colorEnd * 4), glyphStart * 4);
|
|
2034
|
+
}
|
|
2035
|
+
rowIndexBase += data.length;
|
|
2036
|
+
}
|
|
2037
|
+
return (0, import_arrow2.makeArrowFixedSizeListVector)(new import_apache_arrow.Uint8(), 4, expandedValues);
|
|
2038
|
+
}
|
|
2039
|
+
function getArrowTextExpansionNullValue(fieldName, props) {
|
|
2040
|
+
switch (fieldName) {
|
|
2041
|
+
case "colors":
|
|
2042
|
+
return props.color;
|
|
2043
|
+
case "angles":
|
|
2044
|
+
return props.angle;
|
|
2045
|
+
case "sizes":
|
|
2046
|
+
return props.size;
|
|
2047
|
+
default:
|
|
2048
|
+
return void 0;
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
function isArrowDataRowValid(data, localRowIndex) {
|
|
2052
|
+
if (data.nullCount === 0 || !data.nullBitmap) {
|
|
2053
|
+
return true;
|
|
2054
|
+
}
|
|
2055
|
+
const bitmapIndex = (data.offset ?? 0) + localRowIndex;
|
|
2056
|
+
const bitmapByte = data.nullBitmap[bitmapIndex >> 3] ?? 0;
|
|
2057
|
+
return (bitmapByte & 1 << (bitmapIndex & 7)) !== 0;
|
|
2058
|
+
}
|
|
2059
|
+
function makeNumericArrowVector(type, data) {
|
|
2060
|
+
const makeNumericData = import_apache_arrow.makeData;
|
|
2061
|
+
return (0, import_apache_arrow.makeVector)(makeNumericData({
|
|
2062
|
+
type,
|
|
2063
|
+
length: data.length,
|
|
2064
|
+
data
|
|
2065
|
+
}));
|
|
2066
|
+
}
|
|
2067
|
+
function appendTextGlyphLayout(glyphLayout, appendedGlyphLayout) {
|
|
2068
|
+
const nextStartIndices = [
|
|
2069
|
+
...glyphLayout.startIndices,
|
|
2070
|
+
...appendedGlyphLayout.startIndices.slice(1).map((startIndex) => startIndex + glyphLayout.glyphCount)
|
|
2071
|
+
];
|
|
2072
|
+
const glyphOffsets = new Int16Array(glyphLayout.glyphOffsets.length + appendedGlyphLayout.glyphOffsets.length);
|
|
2073
|
+
glyphOffsets.set(glyphLayout.glyphOffsets);
|
|
2074
|
+
glyphOffsets.set(appendedGlyphLayout.glyphOffsets, glyphLayout.glyphOffsets.length);
|
|
2075
|
+
const glyphFrames = new Uint16Array(glyphLayout.glyphFrames.length + appendedGlyphLayout.glyphFrames.length);
|
|
2076
|
+
glyphFrames.set(glyphLayout.glyphFrames);
|
|
2077
|
+
glyphFrames.set(appendedGlyphLayout.glyphFrames, glyphLayout.glyphFrames.length);
|
|
2078
|
+
const glyphPages = new Uint16Array(glyphLayout.glyphPages.length + appendedGlyphLayout.glyphPages.length);
|
|
2079
|
+
glyphPages.set(glyphLayout.glyphPages);
|
|
2080
|
+
glyphPages.set(appendedGlyphLayout.glyphPages, glyphLayout.glyphPages.length);
|
|
2081
|
+
const rowAdvances = new Float32Array(glyphLayout.rowAdvances.length + appendedGlyphLayout.rowAdvances.length);
|
|
2082
|
+
rowAdvances.set(glyphLayout.rowAdvances);
|
|
2083
|
+
rowAdvances.set(appendedGlyphLayout.rowAdvances, glyphLayout.rowAdvances.length);
|
|
2084
|
+
const rowBounds = new Float32Array(glyphLayout.rowBounds.length + appendedGlyphLayout.rowBounds.length);
|
|
2085
|
+
rowBounds.set(glyphLayout.rowBounds);
|
|
2086
|
+
rowBounds.set(appendedGlyphLayout.rowBounds, glyphLayout.rowBounds.length);
|
|
2087
|
+
return {
|
|
2088
|
+
startIndices: nextStartIndices,
|
|
2089
|
+
glyphCount: glyphLayout.glyphCount + appendedGlyphLayout.glyphCount,
|
|
2090
|
+
glyphOffsets,
|
|
2091
|
+
glyphFrames,
|
|
2092
|
+
glyphPages,
|
|
2093
|
+
rowAdvances,
|
|
2094
|
+
rowBounds,
|
|
2095
|
+
characterSet: glyphLayout.characterSet
|
|
2096
|
+
};
|
|
2097
|
+
}
|
|
2098
|
+
function makeGlyphRowIndices(startIndices, rowIndexBase = 0) {
|
|
2099
|
+
const glyphCount = startIndices[startIndices.length - 1] ?? 0;
|
|
2100
|
+
const rowIndices = new Uint32Array(glyphCount);
|
|
2101
|
+
for (let rowIndex = 0; rowIndex < startIndices.length - 1; rowIndex++) {
|
|
2102
|
+
rowIndices.fill(rowIndexBase + rowIndex, startIndices[rowIndex], startIndices[rowIndex + 1]);
|
|
2103
|
+
}
|
|
2104
|
+
return rowIndices;
|
|
2105
|
+
}
|
|
2106
|
+
function getGeneratedAttributeByteLength(columns) {
|
|
2107
|
+
let attributeByteLength = 0;
|
|
2108
|
+
for (const vector of Object.values(columns)) {
|
|
2109
|
+
if (isInstanceCompatibleArrowType(vector.type)) {
|
|
2110
|
+
attributeByteLength += (0, import_arrow2.getArrowVectorBufferSource)(vector).byteLength;
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
return attributeByteLength;
|
|
2114
|
+
}
|
|
2115
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2116
|
+
0 && (module.exports = {
|
|
2117
|
+
appendArrowTextStorageStateBatches,
|
|
2118
|
+
appendTextGlyphLayout,
|
|
2119
|
+
assertArrowTextVectorBatchAlignment,
|
|
2120
|
+
assertArrowTextVectorTypes,
|
|
2121
|
+
buildArrowTextGlyphTable,
|
|
2122
|
+
createArrowTextAttributeState,
|
|
2123
|
+
createArrowTextDictionaryStorageState,
|
|
2124
|
+
createArrowTextRenderTable,
|
|
2125
|
+
createArrowTextStorageState,
|
|
2126
|
+
createExpandedGlyphVertexData,
|
|
2127
|
+
createTextStorageStateFromGPUVectors,
|
|
2128
|
+
packTextStorageClipRects,
|
|
2129
|
+
refreshArrowTextDictionaryStorageRowBindings,
|
|
2130
|
+
refreshArrowTextStorageRowBindings,
|
|
2131
|
+
resolveArrowTextBatchInputs,
|
|
2132
|
+
resolveArrowTextShaderLayout
|
|
2133
|
+
});
|