@null3d/engine 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +176 -0
- package/LICENSE-MIT +21 -0
- package/README.md +108 -2
- package/THIRD-PARTY-NOTICES.txt +637 -0
- package/dist/wasm/single/null3d.js +3972 -0
- package/dist/wasm/single/null3d_bg.wasm +0 -0
- package/dist/wasm/threaded/null3d.js +3988 -0
- package/dist/wasm/threaded/null3d_bg.wasm +0 -0
- package/docs/api/animation.md +492 -0
- package/docs/api/assets.md +400 -0
- package/docs/api/cameras.md +161 -0
- package/docs/api/controls.md +319 -0
- package/docs/api/debug.md +450 -0
- package/docs/api/engine.md +254 -0
- package/docs/api/feature-draws.md +172 -0
- package/docs/api/feature-effects.md +137 -0
- package/docs/api/feature-instances.md +154 -0
- package/docs/api/features.md +323 -0
- package/docs/api/geometry.md +307 -0
- package/docs/api/grass.md +114 -0
- package/docs/api/impostors.md +274 -0
- package/docs/api/input.md +238 -0
- package/docs/api/lights.md +266 -0
- package/docs/api/lines.md +163 -0
- package/docs/api/materials.md +875 -0
- package/docs/api/math.md +129 -0
- package/docs/api/objects.md +155 -0
- package/docs/api/page.md +97 -0
- package/docs/api/particles.md +205 -0
- package/docs/api/points.md +130 -0
- package/docs/api/post.md +494 -0
- package/docs/api/quality.md +200 -0
- package/docs/api/raycast.md +269 -0
- package/docs/api/reference/animation.md +158 -0
- package/docs/api/reference/assets.md +335 -0
- package/docs/api/reference/cameras.md +138 -0
- package/docs/api/reference/controls.md +463 -0
- package/docs/api/reference/debug.md +586 -0
- package/docs/api/reference/engine.md +647 -0
- package/docs/api/reference/feature-draws.md +94 -0
- package/docs/api/reference/feature-effects.md +32 -0
- package/docs/api/reference/feature-instances.md +63 -0
- package/docs/api/reference/features.md +361 -0
- package/docs/api/reference/geometry.md +856 -0
- package/docs/api/reference/grass.md +131 -0
- package/docs/api/reference/impostors.md +368 -0
- package/docs/api/reference/input.md +121 -0
- package/docs/api/reference/lights.md +257 -0
- package/docs/api/reference/lines.md +84 -0
- package/docs/api/reference/materials.md +375 -0
- package/docs/api/reference/math.md +229 -0
- package/docs/api/reference/objects.md +103 -0
- package/docs/api/reference/particles.md +336 -0
- package/docs/api/reference/points.md +57 -0
- package/docs/api/reference/post.md +244 -0
- package/docs/api/reference/quality.md +213 -0
- package/docs/api/reference/raycast.md +94 -0
- package/docs/api/reference/render.md +238 -0
- package/docs/api/reference/scene.md +543 -0
- package/docs/api/reference/sketch.md +125 -0
- package/docs/api/reference/sound.md +203 -0
- package/docs/api/reference/splats.md +214 -0
- package/docs/api/reference/sprites.md +71 -0
- package/docs/api/reference/tasks.md +92 -0
- package/docs/api/reference/terrain.md +161 -0
- package/docs/api/reference/textures.md +153 -0
- package/docs/api/reference/three-compat.md +60 -0
- package/docs/api/reference/time.md +25 -0
- package/docs/api/reference/ui.md +52 -0
- package/docs/api/reference/vertex-draws.md +55 -0
- package/docs/api/reference/water.md +430 -0
- package/docs/api/reference/wind.md +106 -0
- package/docs/api/render.md +499 -0
- package/docs/api/scene.md +606 -0
- package/docs/api/sketch.md +231 -0
- package/docs/api/sound.md +169 -0
- package/docs/api/splats.md +264 -0
- package/docs/api/sprites.md +169 -0
- package/docs/api/tasks.md +106 -0
- package/docs/api/terrain.md +118 -0
- package/docs/api/textures.md +272 -0
- package/docs/api/three-compat.md +102 -0
- package/docs/api/time.md +134 -0
- package/docs/api/ui.md +134 -0
- package/docs/api/vertex-draws.md +171 -0
- package/docs/api/water.md +486 -0
- package/docs/api/wind.md +375 -0
- package/docs/cli/null3d.md +603 -0
- package/docs/concepts/architecture.md +174 -0
- package/docs/concepts/assets.md +128 -0
- package/docs/concepts/backends.md +197 -0
- package/docs/concepts/color-management.md +134 -0
- package/docs/concepts/culling.md +227 -0
- package/docs/concepts/handles.md +93 -0
- package/docs/concepts/instances.md +285 -0
- package/docs/concepts/large-worlds.md +126 -0
- package/docs/concepts/lighting.md +587 -0
- package/docs/concepts/lod.md +241 -0
- package/docs/concepts/materials.md +128 -0
- package/docs/concepts/particle-buffer.md +201 -0
- package/docs/concepts/post-processing.md +420 -0
- package/docs/concepts/quality-preset-tables.md +94 -0
- package/docs/concepts/quality-presets.md +341 -0
- package/docs/concepts/render-graph.md +222 -0
- package/docs/concepts/render-layers.md +111 -0
- package/docs/concepts/shadows.md +448 -0
- package/docs/concepts/static-dynamic.md +113 -0
- package/docs/cookbook/index.md +664 -0
- package/docs/data/threejs-mapping.json +2152 -0
- package/docs/errors/E1101.md +23 -0
- package/docs/errors/E1102.md +23 -0
- package/docs/errors/E1103.md +23 -0
- package/docs/errors/E1104.md +23 -0
- package/docs/errors/E1105.md +23 -0
- package/docs/errors/E1106.md +23 -0
- package/docs/errors/E1107.md +23 -0
- package/docs/errors/E1108.md +23 -0
- package/docs/errors/E1109.md +23 -0
- package/docs/errors/E1110.md +23 -0
- package/docs/errors/E1111.md +23 -0
- package/docs/errors/E1112.md +23 -0
- package/docs/errors/E1203.md +23 -0
- package/docs/errors/E1204.md +23 -0
- package/docs/errors/E1205.md +23 -0
- package/docs/errors/E1206.md +23 -0
- package/docs/errors/E1207.md +23 -0
- package/docs/errors/E1208.md +23 -0
- package/docs/errors/E1209.md +23 -0
- package/docs/errors/E1213.md +23 -0
- package/docs/errors/E1214.md +23 -0
- package/docs/errors/E1215.md +23 -0
- package/docs/errors/E1216.md +23 -0
- package/docs/errors/E1217.md +23 -0
- package/docs/errors/E1218.md +23 -0
- package/docs/errors/E1219.md +23 -0
- package/docs/errors/E1220.md +23 -0
- package/docs/errors/E1221.md +23 -0
- package/docs/errors/E1222.md +23 -0
- package/docs/errors/E1223.md +23 -0
- package/docs/errors/E1224.md +23 -0
- package/docs/errors/E1225.md +23 -0
- package/docs/errors/E1301.md +23 -0
- package/docs/errors/E1302.md +23 -0
- package/docs/errors/E1303.md +23 -0
- package/docs/errors/E1304.md +23 -0
- package/docs/errors/E1305.md +23 -0
- package/docs/errors/E1306.md +23 -0
- package/docs/errors/E1307.md +23 -0
- package/docs/errors/E1401.md +23 -0
- package/docs/errors/E1402.md +23 -0
- package/docs/errors/E1403.md +23 -0
- package/docs/errors/E1404.md +23 -0
- package/docs/errors/E1405.md +23 -0
- package/docs/errors/E1406.md +23 -0
- package/docs/errors/E1407.md +23 -0
- package/docs/errors/E1408.md +23 -0
- package/docs/errors/E1409.md +23 -0
- package/docs/errors/E1410.md +23 -0
- package/docs/errors/E1411.md +23 -0
- package/docs/errors/E1412.md +23 -0
- package/docs/errors/E1413.md +23 -0
- package/docs/errors/E1414.md +23 -0
- package/docs/errors/E1415.md +23 -0
- package/docs/errors/E1416.md +23 -0
- package/docs/errors/E1417.md +23 -0
- package/docs/errors/E1418.md +23 -0
- package/docs/errors/E1419.md +23 -0
- package/docs/errors/E1420.md +23 -0
- package/docs/errors/E1421.md +23 -0
- package/docs/errors/E1422.md +23 -0
- package/docs/errors/E1423.md +23 -0
- package/docs/errors/E1424.md +23 -0
- package/docs/errors/E1425.md +23 -0
- package/docs/errors/E1426.md +23 -0
- package/docs/errors/E1430.md +23 -0
- package/docs/errors/E1431.md +23 -0
- package/docs/errors/E1432.md +23 -0
- package/docs/errors/E1433.md +23 -0
- package/docs/errors/E1434.md +23 -0
- package/docs/errors/E1435.md +23 -0
- package/docs/errors/E1436.md +23 -0
- package/docs/errors/E1437.md +23 -0
- package/docs/errors/E1501.md +23 -0
- package/docs/errors/E1502.md +23 -0
- package/docs/errors/E1503.md +23 -0
- package/docs/errors/E1504.md +23 -0
- package/docs/errors/E1505.md +23 -0
- package/docs/errors/E1506.md +23 -0
- package/docs/errors/index.md +93 -0
- package/docs/getting-started/cdn.md +235 -0
- package/docs/getting-started/first-scene.md +129 -0
- package/docs/getting-started/hosting.md +400 -0
- package/docs/getting-started/install.md +112 -0
- package/docs/getting-started/network-use.md +96 -0
- package/docs/getting-started/project-structure.md +78 -0
- package/docs/getting-started/third-party-notices.md +94 -0
- package/docs/guides/accessibility.md +96 -0
- package/docs/guides/add-ons.md +160 -0
- package/docs/guides/agents.md +77 -0
- package/docs/guides/assets-pipeline.md +505 -0
- package/docs/guides/audio.md +148 -0
- package/docs/guides/baked-light-data.md +176 -0
- package/docs/guides/car-paint.md +121 -0
- package/docs/guides/content-pages.md +238 -0
- package/docs/guides/custom-passes.md +586 -0
- package/docs/guides/custom-shaders.md +293 -0
- package/docs/guides/debugging.md +236 -0
- package/docs/guides/deploying.md +115 -0
- package/docs/guides/deterministic-simulation.md +226 -0
- package/docs/guides/first-use-shaders.md +57 -0
- package/docs/guides/lens-kit.md +134 -0
- package/docs/guides/loading-screens.md +263 -0
- package/docs/guides/multiple-views.md +122 -0
- package/docs/guides/performance.md +405 -0
- package/docs/guides/phones.md +138 -0
- package/docs/guides/physics.md +202 -0
- package/docs/guides/screens.md +125 -0
- package/docs/guides/start-time.md +328 -0
- package/docs/guides/testing.md +245 -0
- package/docs/guides/ui-overlays.md +182 -0
- package/docs/guides/video-textures.md +110 -0
- package/docs/index.md +49 -0
- package/docs/pages.md +242 -0
- package/docs/porting/react-three-fiber.md +238 -0
- package/docs/porting/threejs-loop-and-threads.md +229 -0
- package/docs/porting/threejs-mapping.md +297 -0
- package/docs/porting/threejs-materials.md +222 -0
- package/docs/porting/threejs-overview.md +228 -0
- package/docs/porting/threejs-postprocessing.md +256 -0
- package/docs/porting/threejs-shaders.md +308 -0
- package/docs/porting/threejs-unsupported.md +91 -0
- package/docs/porting/verification.md +191 -0
- package/docs/shaders/builtins.md +129 -0
- package/docs/shaders/library.md +1374 -0
- package/docs/shaders/surface-functions.md +626 -0
- package/docs/shaders/wgsl-rules.md +126 -0
- package/levels/pieces.d.ts +178 -0
- package/levels/pieces.js +759 -0
- package/levels/planner.d.ts +126 -0
- package/levels/planner.js +682 -0
- package/lib/debug/channel.d.ts +103 -0
- package/lib/debug/channel.js +269 -0
- package/lib/debug/debug.d.ts +180 -0
- package/lib/debug/debug.js +4 -0
- package/lib/debug/draw.d.ts +146 -0
- package/lib/debug/draw.js +719 -0
- package/lib/debug/frame-target.d.ts +11 -0
- package/lib/debug/frame-target.js +31 -0
- package/lib/debug/inspector.d.ts +60 -0
- package/lib/debug/inspector.js +475 -0
- package/lib/debug/overlay-look.d.ts +162 -0
- package/lib/debug/overlay-look.js +1365 -0
- package/lib/debug/overlay.d.ts +68 -0
- package/lib/debug/overlay.js +195 -0
- package/lib/debug/page-meters.d.ts +139 -0
- package/lib/debug/page-meters.js +267 -0
- package/lib/debug/sketch-debug.d.ts +41 -0
- package/lib/debug/sketch-debug.js +86 -0
- package/lib/debug/stats-options.d.ts +15 -0
- package/lib/debug/stats-options.js +3 -0
- package/lib/debug/stats-panel.d.ts +94 -0
- package/lib/debug/stats-panel.js +123 -0
- package/lib/debug/stats-text.d.ts +169 -0
- package/lib/debug/stats-text.js +126 -0
- package/lib/debug/stats.d.ts +195 -0
- package/lib/debug/stats.js +252 -0
- package/lib/debug/view-names.d.ts +15 -0
- package/lib/debug/view-names.js +22 -0
- package/lib/errors/checks.d.ts +24 -0
- package/lib/errors/checks.js +38 -0
- package/lib/errors/codes.d.ts +15 -0
- package/lib/errors/codes.js +489 -0
- package/lib/errors/core-failure.d.ts +19 -0
- package/lib/errors/core-failure.js +127 -0
- package/lib/errors/engine-error-core.d.ts +21 -0
- package/lib/errors/engine-error-core.js +39 -0
- package/lib/errors/engine-error.d.ts +38 -0
- package/lib/errors/engine-error.js +132 -0
- package/lib/errors/fixes.d.ts +89 -0
- package/lib/errors/fixes.js +86 -0
- package/lib/errors/message.d.ts +4 -0
- package/lib/errors/message.js +10 -0
- package/lib/generated/core.d.ts +657 -0
- package/lib/generated/core.js +659 -0
- package/lib/generated/gpu.d.ts +412 -0
- package/lib/generated/gpu.js +414 -0
- package/lib/generated/shader-features.d.ts +8 -0
- package/lib/generated/shader-permutations.d.ts +6 -0
- package/lib/generated/shader-permutations.js +9 -0
- package/lib/generated/shaders-environment-glsl.d.ts +11 -0
- package/lib/generated/shaders-environment-wgsl.d.ts +11 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-bump.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-moment.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lines.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-moment.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-area-lights-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-bump-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coat-sheen-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-coverage.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-cutout.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-decals-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-decals.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-displacement.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-hash-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-hash.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-moment-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-moment.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-morph-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-morph.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-motion.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-picking.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-probe-grid-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-probe-grid.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-row-values.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-skinning.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-sprites.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-subsurface-half.d.ts +3 -0
- package/lib/generated/shaders-glsl-combos-subsurface.d.ts +3 -0
- package/lib/generated/shaders-probe-glsl.d.ts +11 -0
- package/lib/generated/shaders-probe-wgsl.d.ts +11 -0
- package/lib/generated/shaders-sky-volume-env-glsl.d.ts +11 -0
- package/lib/generated/shaders-sky-volume-env-wgsl.d.ts +11 -0
- package/lib/generated/shaders-sky-volume-panorama-glsl.d.ts +11 -0
- package/lib/generated/shaders-sky-volume-panorama-wgsl.d.ts +11 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-bump-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-bump.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-coverage.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-displacement.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-hash-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-hash.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-instance-index-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-instance-index.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-lines.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-moment-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-moment.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-row-values.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-skinning.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-translucency-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-translucency.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-transmission-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-transmission.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-weighted-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-area-lights-and-weighted.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-bump-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-bump.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-coat-sheen-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-coat-sheen.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-coverage-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-coverage.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-cutout.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-decals-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-decals.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-displacement-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-displacement.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-hash-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-hash.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-instance-index-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-instance-index.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-lod-fade-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-lod-fade.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-moment-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-moment.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-motion.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-picking.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-probe-grid-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-probe-grid.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-row-values-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-row-values.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-skinning-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-skinning.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-sprites.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-subsurface-half.d.ts +3 -0
- package/lib/generated/shaders-wgsl-combos-subsurface.d.ts +3 -0
- package/lib/generated/shaders.d.ts +1146 -0
- package/lib/gpu/canvas-release.d.ts +20 -0
- package/lib/gpu/canvas-release.js +67 -0
- package/lib/gpu/completion.d.ts +35 -0
- package/lib/gpu/completion.js +256 -0
- package/lib/gpu/device-shaders.d.ts +69 -0
- package/lib/gpu/device-shaders.js +177 -0
- package/lib/gpu/early-builds.d.ts +68 -0
- package/lib/gpu/early-builds.js +158 -0
- package/lib/gpu/effect-join.d.ts +83 -0
- package/lib/gpu/effect-join.js +134 -0
- package/lib/gpu/effect-joiner.d.ts +14 -0
- package/lib/gpu/effect-joiner.js +165 -0
- package/lib/gpu/environment-steps.d.ts +135 -0
- package/lib/gpu/environment-steps.js +210 -0
- package/lib/gpu/environment-words.d.ts +14 -0
- package/lib/gpu/environment-words.js +19 -0
- package/lib/gpu/environment.d.ts +4 -0
- package/lib/gpu/environment.js +8 -0
- package/lib/gpu/float-bits.d.ts +2 -0
- package/lib/gpu/float-bits.js +9 -0
- package/lib/gpu/line-vertices.d.ts +1 -0
- package/lib/gpu/line-vertices.js +14 -0
- package/lib/gpu/memory.d.ts +19 -0
- package/lib/gpu/memory.js +50 -0
- package/lib/gpu/particle-records.d.ts +1 -0
- package/lib/gpu/particle-records.js +15 -0
- package/lib/gpu/pipeline-name.d.ts +6 -0
- package/lib/gpu/pipeline-name.js +23 -0
- package/lib/gpu/probe-steps.d.ts +22 -0
- package/lib/gpu/probe-steps.js +43 -0
- package/lib/gpu/readback.d.ts +32 -0
- package/lib/gpu/readback.js +163 -0
- package/lib/gpu/variants.d.ts +16 -0
- package/lib/gpu/variants.js +67 -0
- package/lib/gpu/vertex-format.d.ts +46 -0
- package/lib/gpu/vertex-format.js +111 -0
- package/lib/gpu/webgl2/backend.d.ts +714 -0
- package/lib/gpu/webgl2/backend.js +2964 -0
- package/lib/gpu/webgl2/call-timing.d.ts +34 -0
- package/lib/gpu/webgl2/call-timing.js +143 -0
- package/lib/gpu/webgl2/context.d.ts +31 -0
- package/lib/gpu/webgl2/context.js +111 -0
- package/lib/gpu/webgl2/depth.d.ts +25 -0
- package/lib/gpu/webgl2/depth.js +30 -0
- package/lib/gpu/webgl2/environment.d.ts +65 -0
- package/lib/gpu/webgl2/environment.js +572 -0
- package/lib/gpu/webgl2/gpu-timer.d.ts +25 -0
- package/lib/gpu/webgl2/gpu-timer.js +93 -0
- package/lib/gpu/webgl2/probes.d.ts +38 -0
- package/lib/gpu/webgl2/probes.js +117 -0
- package/lib/gpu/webgl2/programs.d.ts +238 -0
- package/lib/gpu/webgl2/programs.js +487 -0
- package/lib/gpu/webgpu/backend.d.ts +460 -0
- package/lib/gpu/webgpu/backend.js +1812 -0
- package/lib/gpu/webgpu/buffer-reads.d.ts +42 -0
- package/lib/gpu/webgpu/buffer-reads.js +95 -0
- package/lib/gpu/webgpu/culled-counts.d.ts +79 -0
- package/lib/gpu/webgpu/culled-counts.js +259 -0
- package/lib/gpu/webgpu/draw-path-probe.d.ts +37 -0
- package/lib/gpu/webgpu/draw-path-probe.js +187 -0
- package/lib/gpu/webgpu/environment.d.ts +36 -0
- package/lib/gpu/webgpu/environment.js +735 -0
- package/lib/gpu/webgpu/first-pass.d.ts +13 -0
- package/lib/gpu/webgpu/first-pass.js +61 -0
- package/lib/gpu/webgpu/gpu-timer.d.ts +67 -0
- package/lib/gpu/webgpu/gpu-timer.js +328 -0
- package/lib/gpu/webgpu/indirect-arguments.d.ts +42 -0
- package/lib/gpu/webgpu/indirect-arguments.js +156 -0
- package/lib/gpu/webgpu/pipelines.d.ts +264 -0
- package/lib/gpu/webgpu/pipelines.js +2013 -0
- package/lib/gpu/webgpu/probes.d.ts +27 -0
- package/lib/gpu/webgpu/probes.js +190 -0
- package/lib/gpu/webgpu/reusable.d.ts +74 -0
- package/lib/gpu/webgpu/reusable.js +212 -0
- package/lib/gpu/webgpu/staging.d.ts +79 -0
- package/lib/gpu/webgpu/staging.js +238 -0
- package/lib/gpu/webgpu/upload-routes.d.ts +55 -0
- package/lib/gpu/webgpu/upload-routes.js +128 -0
- package/lib/index.d.ts +121 -0
- package/lib/index.js +54 -0
- package/lib/math/color.d.ts +18 -0
- package/lib/math/color.js +71 -0
- package/lib/math/create-math.d.ts +101 -0
- package/lib/math/create-math.js +207 -0
- package/lib/math/hex.d.ts +8 -0
- package/lib/math/hex.js +38 -0
- package/lib/math/index.d.ts +2 -0
- package/lib/math/index.js +11 -0
- package/lib/math/mat4.d.ts +22 -0
- package/lib/math/mat4.js +206 -0
- package/lib/math/math.d.ts +16 -0
- package/lib/math/math.js +42 -0
- package/lib/math/namespaces/math.d.ts +7 -0
- package/lib/math/namespaces/math.js +14 -0
- package/lib/math/namespaces/quat.d.ts +20 -0
- package/lib/math/namespaces/quat.js +30 -0
- package/lib/math/namespaces/vec3.d.ts +4 -0
- package/lib/math/namespaces/vec3.js +8 -0
- package/lib/math/quat.d.ts +36 -0
- package/lib/math/quat.js +224 -0
- package/lib/math/random.d.ts +16 -0
- package/lib/math/random.js +57 -0
- package/lib/math/types.d.ts +43 -0
- package/lib/math/types.js +4 -0
- package/lib/math/vec3.d.ts +43 -0
- package/lib/math/vec3.js +187 -0
- package/lib/page/abortable.d.ts +2 -0
- package/lib/page/abortable.js +19 -0
- package/lib/page/browser-check.d.ts +8 -0
- package/lib/page/browser-check.js +23 -0
- package/lib/page/canvas-watch.d.ts +34 -0
- package/lib/page/canvas-watch.js +141 -0
- package/lib/page/capabilities.d.ts +201 -0
- package/lib/page/capabilities.js +409 -0
- package/lib/page/check-store.d.ts +54 -0
- package/lib/page/check-store.js +169 -0
- package/lib/page/display.d.ts +2 -0
- package/lib/page/display.js +25 -0
- package/lib/page/early-core.d.ts +1 -0
- package/lib/page/early-core.js +23 -0
- package/lib/page/engine.d.ts +942 -0
- package/lib/page/engine.js +2459 -0
- package/lib/page/first-frame.d.ts +16 -0
- package/lib/page/first-frame.js +35 -0
- package/lib/page/frame-stats.d.ts +402 -0
- package/lib/page/frame-stats.js +389 -0
- package/lib/page/gamepads.d.ts +37 -0
- package/lib/page/gamepads.js +123 -0
- package/lib/page/held-input.d.ts +19 -0
- package/lib/page/held-input.js +54 -0
- package/lib/page/hold.d.ts +186 -0
- package/lib/page/hold.js +49 -0
- package/lib/page/input-ring.d.ts +13 -0
- package/lib/page/input-ring.js +25 -0
- package/lib/page/input.d.ts +6 -0
- package/lib/page/input.js +159 -0
- package/lib/page/isolation-check.d.ts +14 -0
- package/lib/page/isolation-check.js +21 -0
- package/lib/page/label-loop.d.ts +80 -0
- package/lib/page/label-loop.js +417 -0
- package/lib/page/labels.d.ts +56 -0
- package/lib/page/labels.js +102 -0
- package/lib/page/limits.d.ts +321 -0
- package/lib/page/limits.js +323 -0
- package/lib/page/loader.d.ts +78 -0
- package/lib/page/loader.js +149 -0
- package/lib/page/main-thread.d.ts +10 -0
- package/lib/page/main-thread.js +41 -0
- package/lib/page/memory-pool.d.ts +26 -0
- package/lib/page/memory-pool.js +69 -0
- package/lib/page/ownership.d.ts +65 -0
- package/lib/page/ownership.js +166 -0
- package/lib/page/permutation-recording.d.ts +26 -0
- package/lib/page/permutation-recording.js +32 -0
- package/lib/page/pipeline-store.d.ts +25 -0
- package/lib/page/pipeline-store.js +84 -0
- package/lib/page/pointer-lock.d.ts +14 -0
- package/lib/page/pointer-lock.js +60 -0
- package/lib/page/preferences.d.ts +2 -0
- package/lib/page/preferences.js +11 -0
- package/lib/page/record-button.d.ts +5 -0
- package/lib/page/record-button.js +60 -0
- package/lib/page/start-marker.d.ts +47 -0
- package/lib/page/start-marker.js +119 -0
- package/lib/page/stats-switch.d.ts +16 -0
- package/lib/page/stats-switch.js +38 -0
- package/lib/page/stop-jobs.d.ts +37 -0
- package/lib/page/stop-jobs.js +87 -0
- package/lib/page/switches.d.ts +347 -0
- package/lib/page/switches.js +150 -0
- package/lib/page/videos.d.ts +70 -0
- package/lib/page/videos.js +244 -0
- package/lib/quality/budget.d.ts +14 -0
- package/lib/quality/budget.js +25 -0
- package/lib/quality/check.d.ts +119 -0
- package/lib/quality/check.js +84 -0
- package/lib/quality/chooser.d.ts +98 -0
- package/lib/quality/chooser.js +108 -0
- package/lib/quality/device-hints.d.ts +8 -0
- package/lib/quality/device-hints.js +18 -0
- package/lib/quality/governor.d.ts +571 -0
- package/lib/quality/governor.js +1293 -0
- package/lib/quality/preset-docs.d.ts +402 -0
- package/lib/quality/preset-docs.js +179 -0
- package/lib/quality/presets.d.ts +821 -0
- package/lib/quality/presets.js +678 -0
- package/lib/render/direct-loop.d.ts +4 -0
- package/lib/render/direct-loop.js +52 -0
- package/lib/render/draw.d.ts +66 -0
- package/lib/render/draw.js +111 -0
- package/lib/render/load-draw.d.ts +12 -0
- package/lib/render/load-draw.js +18 -0
- package/lib/render/loop.d.ts +241 -0
- package/lib/render/loop.js +566 -0
- package/lib/render/loss.d.ts +53 -0
- package/lib/render/loss.js +127 -0
- package/lib/render/pacer.d.ts +24 -0
- package/lib/render/pacer.js +51 -0
- package/lib/render/recovery.d.ts +82 -0
- package/lib/render/recovery.js +160 -0
- package/lib/render/refresh.d.ts +38 -0
- package/lib/render/refresh.js +111 -0
- package/lib/render/renderer.d.ts +192 -0
- package/lib/render/renderer.js +295 -0
- package/lib/render/scene-renderer.d.ts +135 -0
- package/lib/render/scene-renderer.js +216 -0
- package/lib/render/shader-salt.d.ts +5 -0
- package/lib/render/shader-salt.js +31 -0
- package/lib/render/webgl2-renderers.d.ts +11 -0
- package/lib/render/webgl2-renderers.js +227 -0
- package/lib/render/webgpu-renderers.d.ts +10 -0
- package/lib/render/webgpu-renderers.js +254 -0
- package/lib/scene/addon-debug-views.d.ts +30 -0
- package/lib/scene/addon-debug-views.js +63 -0
- package/lib/scene/animation.d.ts +547 -0
- package/lib/scene/animation.js +1425 -0
- package/lib/scene/area-light-tables.d.ts +32 -0
- package/lib/scene/area-light-tables.js +89 -0
- package/lib/scene/assets.d.ts +375 -0
- package/lib/scene/assets.js +736 -0
- package/lib/scene/background.d.ts +238 -0
- package/lib/scene/background.js +470 -0
- package/lib/scene/baked-light.d.ts +60 -0
- package/lib/scene/baked-light.js +300 -0
- package/lib/scene/builtin-environments.d.ts +36 -0
- package/lib/scene/builtin-environments.js +43 -0
- package/lib/scene/chunk-rows.d.ts +81 -0
- package/lib/scene/chunk-rows.js +146 -0
- package/lib/scene/color.d.ts +22 -0
- package/lib/scene/color.js +45 -0
- package/lib/scene/derived-cache.d.ts +139 -0
- package/lib/scene/derived-cache.js +547 -0
- package/lib/scene/downloads.d.ts +2 -0
- package/lib/scene/downloads.js +371 -0
- package/lib/scene/effects.d.ts +193 -0
- package/lib/scene/effects.js +476 -0
- package/lib/scene/environment-file.d.ts +22 -0
- package/lib/scene/environment-file.js +81 -0
- package/lib/scene/environment.d.ts +57 -0
- package/lib/scene/environment.js +131 -0
- package/lib/scene/fake-call-values.d.ts +8 -0
- package/lib/scene/fake-call-values.js +51 -0
- package/lib/scene/feature-draws.d.ts +169 -0
- package/lib/scene/feature-draws.js +269 -0
- package/lib/scene/feature-effects.d.ts +42 -0
- package/lib/scene/feature-effects.js +155 -0
- package/lib/scene/feature-host.d.ts +129 -0
- package/lib/scene/feature-host.js +299 -0
- package/lib/scene/feature-instances.d.ts +130 -0
- package/lib/scene/feature-instances.js +326 -0
- package/lib/scene/features.d.ts +412 -0
- package/lib/scene/features.js +550 -0
- package/lib/scene/file-limits.d.ts +70 -0
- package/lib/scene/file-limits.js +224 -0
- package/lib/scene/fog.d.ts +101 -0
- package/lib/scene/fog.js +148 -0
- package/lib/scene/frame-cameras.d.ts +175 -0
- package/lib/scene/frame-cameras.js +492 -0
- package/lib/scene/gltf-animation.d.ts +129 -0
- package/lib/scene/gltf-animation.js +887 -0
- package/lib/scene/gltf-draco.d.ts +9 -0
- package/lib/scene/gltf-draco.js +224 -0
- package/lib/scene/gltf-extensions.d.ts +31 -0
- package/lib/scene/gltf-extensions.js +92 -0
- package/lib/scene/gltf-json.d.ts +49 -0
- package/lib/scene/gltf-json.js +94 -0
- package/lib/scene/gltf-math.d.ts +16 -0
- package/lib/scene/gltf-math.js +129 -0
- package/lib/scene/gltf-meshopt.d.ts +3 -0
- package/lib/scene/gltf-meshopt.js +48 -0
- package/lib/scene/gltf-parse.d.ts +600 -0
- package/lib/scene/gltf-parse.js +1854 -0
- package/lib/scene/gltf.d.ts +189 -0
- package/lib/scene/gltf.js +1589 -0
- package/lib/scene/grade-table.d.ts +9 -0
- package/lib/scene/grade-table.js +23 -0
- package/lib/scene/grade-task.d.ts +12 -0
- package/lib/scene/grade-task.js +11 -0
- package/lib/scene/grading.d.ts +110 -0
- package/lib/scene/grading.js +142 -0
- package/lib/scene/half-float.d.ts +4 -0
- package/lib/scene/half-float.js +42 -0
- package/lib/scene/ktx2-cache.d.ts +32 -0
- package/lib/scene/ktx2-cache.js +62 -0
- package/lib/scene/ktx2-file.d.ts +57 -0
- package/lib/scene/ktx2-file.js +207 -0
- package/lib/scene/ktx2-transcode.d.ts +15 -0
- package/lib/scene/ktx2-transcode.js +94 -0
- package/lib/scene/ktx2.d.ts +42 -0
- package/lib/scene/ktx2.js +179 -0
- package/lib/scene/lens.d.ts +61 -0
- package/lib/scene/lens.js +101 -0
- package/lib/scene/level-meshopt.d.ts +20 -0
- package/lib/scene/level-meshopt.js +122 -0
- package/lib/scene/level-pieces.d.ts +24 -0
- package/lib/scene/level-pieces.js +138 -0
- package/lib/scene/level-rule.d.ts +120 -0
- package/lib/scene/level-rule.js +130 -0
- package/lib/scene/level-words.d.ts +19 -0
- package/lib/scene/level-words.js +34 -0
- package/lib/scene/levels-task.d.ts +51 -0
- package/lib/scene/levels-task.js +132 -0
- package/lib/scene/light-images.d.ts +36 -0
- package/lib/scene/light-images.js +88 -0
- package/lib/scene/light-probes.d.ts +240 -0
- package/lib/scene/light-probes.js +644 -0
- package/lib/scene/lines.d.ts +188 -0
- package/lib/scene/lines.js +257 -0
- package/lib/scene/lut-files.d.ts +41 -0
- package/lib/scene/lut-files.js +399 -0
- package/lib/scene/lut.d.ts +55 -0
- package/lib/scene/lut.js +47 -0
- package/lib/scene/memory.d.ts +72 -0
- package/lib/scene/memory.js +159 -0
- package/lib/scene/mesh-arrays.d.ts +110 -0
- package/lib/scene/mesh-arrays.js +701 -0
- package/lib/scene/mesh-levels.d.ts +10 -0
- package/lib/scene/mesh-levels.js +52 -0
- package/lib/scene/namespaces.d.ts +125 -0
- package/lib/scene/namespaces.js +313 -0
- package/lib/scene/panorama-files.d.ts +71 -0
- package/lib/scene/panorama-files.js +1103 -0
- package/lib/scene/panorama.d.ts +23 -0
- package/lib/scene/panorama.js +108 -0
- package/lib/scene/particles.d.ts +452 -0
- package/lib/scene/particles.js +814 -0
- package/lib/scene/pass-reads.d.ts +70 -0
- package/lib/scene/pass-reads.js +220 -0
- package/lib/scene/picks.d.ts +69 -0
- package/lib/scene/picks.js +208 -0
- package/lib/scene/pointer-events.d.ts +202 -0
- package/lib/scene/pointer-events.js +500 -0
- package/lib/scene/post.d.ts +567 -0
- package/lib/scene/post.js +928 -0
- package/lib/scene/prefab.d.ts +109 -0
- package/lib/scene/prefab.js +166 -0
- package/lib/scene/probes.d.ts +71 -0
- package/lib/scene/probes.js +169 -0
- package/lib/scene/property-animation.d.ts +160 -0
- package/lib/scene/property-animation.js +276 -0
- package/lib/scene/queries.d.ts +176 -0
- package/lib/scene/queries.js +393 -0
- package/lib/scene/render.d.ts +487 -0
- package/lib/scene/render.js +829 -0
- package/lib/scene/resources.d.ts +1598 -0
- package/lib/scene/resources.js +2843 -0
- package/lib/scene/rotation.d.ts +6 -0
- package/lib/scene/rotation.js +12 -0
- package/lib/scene/scene.d.ts +1858 -0
- package/lib/scene/scene.js +4680 -0
- package/lib/scene/serial-loads.d.ts +29 -0
- package/lib/scene/serial-loads.js +68 -0
- package/lib/scene/shader-preloads.d.ts +74 -0
- package/lib/scene/shader-preloads.js +116 -0
- package/lib/scene/shader-templates.d.ts +60 -0
- package/lib/scene/shader-templates.js +156 -0
- package/lib/scene/sprites.d.ts +262 -0
- package/lib/scene/sprites.js +292 -0
- package/lib/scene/stale-calls-scenario.d.ts +20 -0
- package/lib/scene/stale-calls-scenario.js +175 -0
- package/lib/scene/textures.d.ts +323 -0
- package/lib/scene/textures.js +953 -0
- package/lib/scene/time-of-day.d.ts +145 -0
- package/lib/scene/time-of-day.js +644 -0
- package/lib/scene/unmarked-writes.d.ts +118 -0
- package/lib/scene/unmarked-writes.js +283 -0
- package/lib/scene/unread-extensions-scenario.d.ts +6 -0
- package/lib/scene/unread-extensions-scenario.js +26 -0
- package/lib/scene/vertex-draws.d.ts +82 -0
- package/lib/scene/vertex-draws.js +85 -0
- package/lib/scene/wgsl-uniforms.d.ts +167 -0
- package/lib/scene/wgsl-uniforms.js +12 -0
- package/lib/shader-artifact.json +1 -0
- package/lib/shared/await-later.d.ts +5 -0
- package/lib/shared/await-later.js +10 -0
- package/lib/shared/control.d.ts +94 -0
- package/lib/shared/control.js +150 -0
- package/lib/shared/core-sources.d.ts +2 -0
- package/lib/shared/core-sources.js +7 -0
- package/lib/shared/core.d.ts +1254 -0
- package/lib/shared/core.js +381 -0
- package/lib/shared/counter.d.ts +52 -0
- package/lib/shared/counter.js +55 -0
- package/lib/shared/dev.d.ts +8 -0
- package/lib/shared/dev.js +13 -0
- package/lib/shared/feature-stats.d.ts +16 -0
- package/lib/shared/feature-stats.js +27 -0
- package/lib/shared/frame-image.d.ts +13 -0
- package/lib/shared/frame-image.js +32 -0
- package/lib/shared/gpu-clock.d.ts +14 -0
- package/lib/shared/gpu-clock.js +38 -0
- package/lib/shared/gpu-counter.d.ts +12 -0
- package/lib/shared/gpu-counter.js +15 -0
- package/lib/shared/gpu-scope.d.ts +14 -0
- package/lib/shared/gpu-scope.js +104 -0
- package/lib/shared/helper-workers.d.ts +4 -0
- package/lib/shared/helper-workers.js +23 -0
- package/lib/shared/images.d.ts +255 -0
- package/lib/shared/images.js +450 -0
- package/lib/shared/import-once.d.ts +6 -0
- package/lib/shared/import-once.js +19 -0
- package/lib/shared/key-codes.d.ts +2 -0
- package/lib/shared/key-codes.js +69 -0
- package/lib/shared/labels.d.ts +94 -0
- package/lib/shared/labels.js +172 -0
- package/lib/shared/memory-area.d.ts +6 -0
- package/lib/shared/memory-area.js +21 -0
- package/lib/shared/memory-figure.d.ts +14 -0
- package/lib/shared/memory-figure.js +18 -0
- package/lib/shared/memory-views.d.ts +48 -0
- package/lib/shared/memory-views.js +90 -0
- package/lib/shared/metrics.d.ts +353 -0
- package/lib/shared/metrics.js +799 -0
- package/lib/shared/page-measurement.d.ts +9 -0
- package/lib/shared/page-measurement.js +37 -0
- package/lib/shared/phase.d.ts +17 -0
- package/lib/shared/phase.js +20 -0
- package/lib/shared/policy.d.ts +20 -0
- package/lib/shared/policy.js +46 -0
- package/lib/shared/recording.d.ts +100 -0
- package/lib/shared/recording.js +378 -0
- package/lib/shared/role.d.ts +10 -0
- package/lib/shared/role.js +13 -0
- package/lib/shared/run-task.d.ts +39 -0
- package/lib/shared/run-task.js +69 -0
- package/lib/shared/slot.d.ts +218 -0
- package/lib/shared/slot.js +221 -0
- package/lib/shared/software.d.ts +24 -0
- package/lib/shared/software.js +22 -0
- package/lib/shared/stats.d.ts +62 -0
- package/lib/shared/stats.js +86 -0
- package/lib/shared/task-failure.d.ts +24 -0
- package/lib/shared/task-failure.js +36 -0
- package/lib/shared/task-host.d.ts +42 -0
- package/lib/shared/task-host.js +60 -0
- package/lib/shared/task-load-error.d.ts +10 -0
- package/lib/shared/task-load-error.js +13 -0
- package/lib/shared/task-modules.d.ts +2 -0
- package/lib/shared/task-modules.js +8 -0
- package/lib/shared/task-pending.d.ts +24 -0
- package/lib/shared/task-pending.js +101 -0
- package/lib/shared/tasks.d.ts +54 -0
- package/lib/shared/tasks.js +426 -0
- package/lib/shared/tier.d.ts +7 -0
- package/lib/shared/tier.js +3 -0
- package/lib/shared/version.d.ts +72 -0
- package/lib/shared/version.js +103 -0
- package/lib/shared/videos.d.ts +15 -0
- package/lib/shared/videos.js +11 -0
- package/lib/shared/wake.d.ts +38 -0
- package/lib/shared/wake.js +76 -0
- package/lib/shared/wasm-limits.d.ts +13 -0
- package/lib/shared/wasm-limits.js +75 -0
- package/lib/shared/wasm.d.ts +34 -0
- package/lib/shared/wasm.js +151 -0
- package/lib/shared/webkit.d.ts +33 -0
- package/lib/shared/webkit.js +59 -0
- package/lib/shared/wgsl-updates.d.ts +9 -0
- package/lib/shared/wgsl-updates.js +8 -0
- package/lib/shared/worker-start.d.ts +56 -0
- package/lib/shared/worker-start.js +186 -0
- package/lib/sketch/clock.d.ts +61 -0
- package/lib/sketch/clock.js +98 -0
- package/lib/sketch/define-sketch.d.ts +269 -0
- package/lib/sketch/define-sketch.js +103 -0
- package/lib/sketch/input-off-scenario.d.ts +7 -0
- package/lib/sketch/input-off-scenario.js +24 -0
- package/lib/sketch/input-off.d.ts +16 -0
- package/lib/sketch/input-off.js +38 -0
- package/lib/sketch/input.d.ts +243 -0
- package/lib/sketch/input.js +554 -0
- package/lib/sketch/preset-check.d.ts +42 -0
- package/lib/sketch/preset-check.js +120 -0
- package/lib/sketch/quality.d.ts +392 -0
- package/lib/sketch/quality.js +355 -0
- package/lib/sketch/random.d.ts +13 -0
- package/lib/sketch/random.js +25 -0
- package/lib/sketch/runner.d.ts +574 -0
- package/lib/sketch/runner.js +2159 -0
- package/lib/sketch/ui.d.ts +94 -0
- package/lib/sketch/ui.js +391 -0
- package/lib/stats.d.ts +4 -0
- package/lib/stats.js +8 -0
- package/lib/workers/drawing-host.d.ts +24 -0
- package/lib/workers/drawing-host.js +48 -0
- package/lib/workers/gltf-worker.d.ts +35 -0
- package/lib/workers/gltf-worker.js +210 -0
- package/lib/workers/job-worker.d.ts +1 -0
- package/lib/workers/job-worker.js +102 -0
- package/lib/workers/panorama-worker.d.ts +15 -0
- package/lib/workers/panorama-worker.js +21 -0
- package/lib/workers/probe-worker.d.ts +34 -0
- package/lib/workers/probe-worker.js +58 -0
- package/lib/workers/protocol.d.ts +377 -0
- package/lib/workers/protocol.js +57 -0
- package/lib/workers/render-worker.d.ts +1 -0
- package/lib/workers/render-worker.js +103 -0
- package/lib/workers/sketch-worker.d.ts +1 -0
- package/lib/workers/sketch-worker.js +295 -0
- package/lib/workers/task-worker.d.ts +1 -0
- package/lib/workers/task-worker.js +5 -0
- package/lib/workers/tasks.d.ts +65 -0
- package/lib/workers/tasks.js +85 -0
- package/package.json +106 -5
- package/vendor/basis/LICENSE +201 -0
- package/vendor/basis/LICENSE-zstd +30 -0
- package/vendor/basis/NOTICE +15 -0
- package/vendor/basis/basis_transcoder.d.mts +36 -0
- package/vendor/basis/basis_transcoder.mjs +2 -0
- package/vendor/basis/basis_transcoder.wasm +0 -0
- package/vendor/draco/LICENSE +252 -0
- package/vendor/draco/draco_decoder_gltf.wasm +0 -0
- package/vendor/draco/draco_wasm_wrapper_gltf.d.ts +71 -0
- package/vendor/draco/draco_wasm_wrapper_gltf.js +116 -0
- package/vendor/ltc/LICENSE +31 -0
- package/vendor/ltc/area-light-tables.bin +0 -0
- package/vendor/meshopt/LICENSE.md +21 -0
- package/vendor/meshopt/meshopt_clusterizer.wasm +0 -0
- package/vendor/meshopt/meshopt_decoder.wasm +0 -0
- package/vendor/meshopt/meshopt_encoder.wasm +0 -0
- package/vendor/meshopt/meshopt_simplifier.wasm +0 -0
|
@@ -0,0 +1,1812 @@
|
|
|
1
|
+
// The WebGPU backend: owns every GPU object in tables indexed by the core's resource ids, and
|
|
2
|
+
// replays binary draw lists into WebGPU calls. The replay loop reads 32-bit words from a view on
|
|
3
|
+
// engine memory and allocates nothing per command, except when a command creates a GPU object.
|
|
4
|
+
import { messageOf } from '../../errors/message.js';
|
|
5
|
+
import { SHADING_CUSTOM_FIRST } from '../../generated/core.js';
|
|
6
|
+
import * as G from '../../generated/gpu.js';
|
|
7
|
+
import { DEV } from '../../shared/dev.js';
|
|
8
|
+
import { ImageTable } from '../../shared/images.js';
|
|
9
|
+
import { DROP_COUNTED_LABEL } from '../../shared/metrics.js';
|
|
10
|
+
import { EarlyBuilds, keyOf, PipelineListing } from '../early-builds.js';
|
|
11
|
+
import { JoinedBuilds, joinedReady } from '../effect-join.js';
|
|
12
|
+
import { CLOUD_FIELD_WORD, CLOUD_STEPS_WORD, LAYER_WORD, LIGHT_BUFFER_WORD, } from '../environment-words.js';
|
|
13
|
+
import { floatOfBits } from '../float-bits.js';
|
|
14
|
+
import { GpuMemory, textureBytes } from '../memory.js';
|
|
15
|
+
import { variantFor } from '../variants.js';
|
|
16
|
+
import { BufferReads } from './buffer-reads.js';
|
|
17
|
+
import { IndirectArguments } from './indirect-arguments.js';
|
|
18
|
+
import { Pipelines, SKIN_BUILDS } from './pipelines.js';
|
|
19
|
+
import { RenderPassSetup, submitOne, TexelCopySetup } from './reusable.js';
|
|
20
|
+
import { StagingRing } from './staging.js';
|
|
21
|
+
import { UploadRoutes } from './upload-routes.js';
|
|
22
|
+
/**
|
|
23
|
+
* The operands of a `CreateRenderPipeline` command: its id, template, permutation, color and depth
|
|
24
|
+
* formats, sample count, state flags, vertex format, and depth bias and slope.
|
|
25
|
+
*/
|
|
26
|
+
const RENDER_PIPELINE_OPERANDS = 10;
|
|
27
|
+
const TEXTURE_FORMATS = [];
|
|
28
|
+
TEXTURE_FORMATS[G.FORMAT_RGBA8_UNORM] = 'rgba8unorm';
|
|
29
|
+
TEXTURE_FORMATS[G.FORMAT_RGBA8_UNORM_SRGB] = 'rgba8unorm-srgb';
|
|
30
|
+
TEXTURE_FORMATS[G.FORMAT_BGRA8_UNORM] = 'bgra8unorm';
|
|
31
|
+
TEXTURE_FORMATS[G.FORMAT_RGBA16_FLOAT] = 'rgba16float';
|
|
32
|
+
TEXTURE_FORMATS[G.FORMAT_RG11B10_UFLOAT] = 'rg11b10ufloat';
|
|
33
|
+
TEXTURE_FORMATS[G.FORMAT_DEPTH24_PLUS] = 'depth24plus';
|
|
34
|
+
TEXTURE_FORMATS[G.FORMAT_DEPTH32_FLOAT] = 'depth32float';
|
|
35
|
+
TEXTURE_FORMATS[G.FORMAT_DEPTH16_UNORM] = 'depth16unorm';
|
|
36
|
+
TEXTURE_FORMATS[G.FORMAT_RGBA32_FLOAT] = 'rgba32float';
|
|
37
|
+
TEXTURE_FORMATS[G.FORMAT_R32_UINT] = 'r32uint';
|
|
38
|
+
TEXTURE_FORMATS[G.FORMAT_ASTC_4X4_UNORM] = 'astc-4x4-unorm';
|
|
39
|
+
TEXTURE_FORMATS[G.FORMAT_ASTC_4X4_UNORM_SRGB] = 'astc-4x4-unorm-srgb';
|
|
40
|
+
TEXTURE_FORMATS[G.FORMAT_BC7_RGBA_UNORM] = 'bc7-rgba-unorm';
|
|
41
|
+
TEXTURE_FORMATS[G.FORMAT_BC7_RGBA_UNORM_SRGB] = 'bc7-rgba-unorm-srgb';
|
|
42
|
+
TEXTURE_FORMATS[G.FORMAT_BC6H_RGB_UFLOAT] = 'bc6h-rgb-ufloat';
|
|
43
|
+
TEXTURE_FORMATS[G.FORMAT_ETC2_RGB8_UNORM] = 'etc2-rgb8unorm';
|
|
44
|
+
TEXTURE_FORMATS[G.FORMAT_ETC2_RGB8_UNORM_SRGB] = 'etc2-rgb8unorm-srgb';
|
|
45
|
+
TEXTURE_FORMATS[G.FORMAT_ETC2_RGBA8_UNORM] = 'etc2-rgba8unorm';
|
|
46
|
+
TEXTURE_FORMATS[G.FORMAT_ETC2_RGBA8_UNORM_SRGB] = 'etc2-rgba8unorm-srgb';
|
|
47
|
+
TEXTURE_FORMATS[G.FORMAT_RGB9E5_UFLOAT] = 'rgb9e5ufloat';
|
|
48
|
+
TEXTURE_FORMATS[G.FORMAT_R32_FLOAT] = 'r32float';
|
|
49
|
+
TEXTURE_FORMATS[G.FORMAT_RGBA32_UINT] = 'rgba32uint';
|
|
50
|
+
TEXTURE_FORMATS[G.FORMAT_RG16_FLOAT] = 'rg16float';
|
|
51
|
+
TEXTURE_FORMATS[G.FORMAT_R16_FLOAT] = 'r16float';
|
|
52
|
+
/** The bytes that each row of texels in a buffer copy must be a multiple of. */
|
|
53
|
+
const ROW_ALIGNMENT = 256;
|
|
54
|
+
/**
|
|
55
|
+
* Bits of the scale draw's instance that hold the texels across the destination: a light's image
|
|
56
|
+
* takes at most 512, so they fit in ten. The source's layer sits above them. The mipmap shader's
|
|
57
|
+
* scale pipeline reads both.
|
|
58
|
+
*/
|
|
59
|
+
const SCALE_SIZE_BITS = 10;
|
|
60
|
+
const VIEW_DIMENSIONS = [];
|
|
61
|
+
VIEW_DIMENSIONS[G.VIEW_2D] = '2d';
|
|
62
|
+
VIEW_DIMENSIONS[G.VIEW_2D_ARRAY] = '2d-array';
|
|
63
|
+
VIEW_DIMENSIONS[G.VIEW_CUBE] = 'cube';
|
|
64
|
+
VIEW_DIMENSIONS[G.VIEW_3D] = '3d';
|
|
65
|
+
const ADDRESS_MODES = [];
|
|
66
|
+
ADDRESS_MODES[G.ADDRESS_CLAMP_TO_EDGE] = 'clamp-to-edge';
|
|
67
|
+
ADDRESS_MODES[G.ADDRESS_REPEAT] = 'repeat';
|
|
68
|
+
ADDRESS_MODES[G.ADDRESS_MIRROR_REPEAT] = 'mirror-repeat';
|
|
69
|
+
const FILTERS = [];
|
|
70
|
+
FILTERS[G.FILTER_NEAREST] = 'nearest';
|
|
71
|
+
FILTERS[G.FILTER_LINEAR] = 'linear';
|
|
72
|
+
/** Compare functions by code; `COMPARE_NONE` has none, which makes a sampler that reads texels. */
|
|
73
|
+
const COMPARE_FUNCTIONS = [];
|
|
74
|
+
COMPARE_FUNCTIONS[G.COMPARE_NEVER] = 'never';
|
|
75
|
+
COMPARE_FUNCTIONS[G.COMPARE_LESS] = 'less';
|
|
76
|
+
COMPARE_FUNCTIONS[G.COMPARE_EQUAL] = 'equal';
|
|
77
|
+
COMPARE_FUNCTIONS[G.COMPARE_LESS_EQUAL] = 'less-equal';
|
|
78
|
+
COMPARE_FUNCTIONS[G.COMPARE_GREATER] = 'greater';
|
|
79
|
+
COMPARE_FUNCTIONS[G.COMPARE_NOT_EQUAL] = 'not-equal';
|
|
80
|
+
COMPARE_FUNCTIONS[G.COMPARE_GREATER_EQUAL] = 'greater-equal';
|
|
81
|
+
COMPARE_FUNCTIONS[G.COMPARE_ALWAYS] = 'always';
|
|
82
|
+
/**
|
|
83
|
+
* The compute pipelines that a preloaded feature's file builds at once, each a template and its
|
|
84
|
+
* permutation bits: their layouts are fixed, so the scene need not draw first.
|
|
85
|
+
*/
|
|
86
|
+
const PRECOMPILED = {
|
|
87
|
+
skinning: SKIN_BUILDS.map((bits) => [G.TEMPLATE_SKIN, bits]),
|
|
88
|
+
occlusion: [
|
|
89
|
+
[G.TEMPLATE_OCCLUSION_EARLY, 0],
|
|
90
|
+
[G.TEMPLATE_OCCLUSION_LATE, 0],
|
|
91
|
+
[G.TEMPLATE_DEPTH_PYRAMID, 0],
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
/** Reads a code from a table, and fails with its kind when the table has no entry for it. */
|
|
95
|
+
function lookUp(table, code, what) {
|
|
96
|
+
const value = table[code];
|
|
97
|
+
if (value === undefined)
|
|
98
|
+
throw new Error(`unknown ${what} ${code}`);
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A pass command's label. The label follows the second color target, and takes its place in a list
|
|
103
|
+
* that names no second target. A list that names no label, as a hand-made one may, gives 0.
|
|
104
|
+
*/
|
|
105
|
+
function passLabel(a, length, words) {
|
|
106
|
+
if (length > 12)
|
|
107
|
+
return words[a + 10];
|
|
108
|
+
if (length > 10)
|
|
109
|
+
return words[a + 9];
|
|
110
|
+
return 0;
|
|
111
|
+
}
|
|
112
|
+
/** A pass command's scope, which follows the label, or 0 for a list that names none. */
|
|
113
|
+
function passScope(a, length, words) {
|
|
114
|
+
if (length > 12)
|
|
115
|
+
return words[a + 11];
|
|
116
|
+
if (length > 11)
|
|
117
|
+
return words[a + 10];
|
|
118
|
+
return 0;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* True for a pipeline build that the GPU's driver refused, as a `GPUPipelineError` whose reason is
|
|
122
|
+
* `internal`: it ran out of memory, or its compiler refused the shader. The browser's validation
|
|
123
|
+
* of the engine's descriptor gives the reason `validation`.
|
|
124
|
+
*/
|
|
125
|
+
export function refusedByDriver(error) {
|
|
126
|
+
return error?.reason === 'internal';
|
|
127
|
+
}
|
|
128
|
+
export class WebGPUBackend {
|
|
129
|
+
device;
|
|
130
|
+
context;
|
|
131
|
+
routes;
|
|
132
|
+
buffers = [];
|
|
133
|
+
textures = [];
|
|
134
|
+
/** Each texture's format code, for the blocks of texels of its writes. */
|
|
135
|
+
formats = [];
|
|
136
|
+
/** Each texture's bytes on the GPU, which its release takes off the memory total. */
|
|
137
|
+
textureSizes = [];
|
|
138
|
+
/** The GPU memory of every texture and buffer that the backend and its helpers hold. */
|
|
139
|
+
gpuMemory = new GpuMemory();
|
|
140
|
+
/** Each texture's view for bind groups: the whole texture, in the dimension it was made with. */
|
|
141
|
+
bindingViews = [];
|
|
142
|
+
/** The view dimension that each texture's bind groups see, which its bind views share. */
|
|
143
|
+
viewDimensions = [];
|
|
144
|
+
/** Each render target's view: a texture of one layer and one mip level, or a view of one. */
|
|
145
|
+
targetViews = [];
|
|
146
|
+
samplers = [];
|
|
147
|
+
/** Images for uploads, by id, which outlive the backend when the drawing thread owns them. */
|
|
148
|
+
images;
|
|
149
|
+
/** The builds of joined effects' shaders, which never stop the engine when they fail. */
|
|
150
|
+
joins;
|
|
151
|
+
ownsImages;
|
|
152
|
+
/** The sampler that mip levels read the level before them with. */
|
|
153
|
+
mipSampler;
|
|
154
|
+
/** What making each texture's mip levels draws with, by texture id, once it made them. */
|
|
155
|
+
mipChains = [];
|
|
156
|
+
/**
|
|
157
|
+
* Pipelines by id: null while one builds or after the GPU's driver refused it, and undefined for
|
|
158
|
+
* an id that names none. A null pipeline's draws draw nothing.
|
|
159
|
+
*/
|
|
160
|
+
renderPipelines = [];
|
|
161
|
+
/** True for each render pipeline, by id, that draws lines rather than triangles. */
|
|
162
|
+
lineLists = [];
|
|
163
|
+
/** True while the render pass's pipeline draws lines. */
|
|
164
|
+
lines = false;
|
|
165
|
+
computePipelines = [];
|
|
166
|
+
/** Pipelines that are building, or that wait for their custom material's shader or a retry. */
|
|
167
|
+
builds = 0;
|
|
168
|
+
/** The builds that the browser runs now. */
|
|
169
|
+
running = 0;
|
|
170
|
+
/**
|
|
171
|
+
* The render pipelines of the scene's objects whose build the GPU's driver refused once. Each
|
|
172
|
+
* builds once more, alone, once no other build runs: a driver can run short of memory while it
|
|
173
|
+
* compiles many shaders at once.
|
|
174
|
+
*/
|
|
175
|
+
retries = [];
|
|
176
|
+
/**
|
|
177
|
+
* Hears each render pipeline that the GPU's driver refused twice, by its name and the driver's
|
|
178
|
+
* reason. Its draws draw nothing from then on, and the frames go on without them.
|
|
179
|
+
*/
|
|
180
|
+
refused;
|
|
181
|
+
/**
|
|
182
|
+
* The operands of each `CreateRenderPipeline` whose custom material's shader has not reached
|
|
183
|
+
* this thread yet. Each builds once its shader arrives.
|
|
184
|
+
*/
|
|
185
|
+
parked = [];
|
|
186
|
+
/**
|
|
187
|
+
* In development builds, the operands of each render pipeline of a custom material, by
|
|
188
|
+
* pipeline id, which a hot update of the material's shader builds again.
|
|
189
|
+
*/
|
|
190
|
+
customOperands = new Map();
|
|
191
|
+
/** The newest hot rebuild of each pipeline, by pipeline id, and the count of rebuilds so far. */
|
|
192
|
+
swaps = new Map();
|
|
193
|
+
swapCount = 0;
|
|
194
|
+
/**
|
|
195
|
+
* The operands of each `CreateComputePipeline` whose shader file has not arrived yet: the
|
|
196
|
+
* skinning pass's, which loads with the first skinned mesh. Each builds once its file arrives.
|
|
197
|
+
*/
|
|
198
|
+
parkedCompute = [];
|
|
199
|
+
/** The create commands of the pipelines that the lists before the first frame create. */
|
|
200
|
+
listing = new PipelineListing();
|
|
201
|
+
/** The builds of the pipelines that the last start's first frame built, until this first frame. */
|
|
202
|
+
early;
|
|
203
|
+
/**
|
|
204
|
+
* The builds of the pipelines that a list before the first frame creates after other commands,
|
|
205
|
+
* by the id that the command creates, with the command's key. They start when the list is
|
|
206
|
+
* prepared, and the frame waits for them.
|
|
207
|
+
*/
|
|
208
|
+
ahead = new Map();
|
|
209
|
+
/**
|
|
210
|
+
* The builds of `ahead` by the command's key: commands of equal operands under other ids, such
|
|
211
|
+
* as an add-on's compute passes of one shader, share one build. Built one after another, the
|
|
212
|
+
* browser's cache of equal pipelines answers each after the first; started at once, each would
|
|
213
|
+
* compile the shader again.
|
|
214
|
+
*/
|
|
215
|
+
aheadByKey = new Map();
|
|
216
|
+
/**
|
|
217
|
+
* True when the vertex shaders skin skinned meshes, so a preload of skinning prepares the
|
|
218
|
+
* shaders of its SKIN builds.
|
|
219
|
+
*/
|
|
220
|
+
skinsInVertexShaders = false;
|
|
221
|
+
/** Why a pipeline failed to build, which the next replay reports. */
|
|
222
|
+
buildFailure;
|
|
223
|
+
/** The opcode and word of the command that the replay is carrying out. */
|
|
224
|
+
replayOp = -1;
|
|
225
|
+
replayWord = -1;
|
|
226
|
+
/** True while the render pass's pipeline is building: its draws draw nothing until it is set again. */
|
|
227
|
+
skipDraws = false;
|
|
228
|
+
/** True while the compute pass's pipeline is building: its dispatches do nothing. */
|
|
229
|
+
skipDispatches = false;
|
|
230
|
+
bindGroups = [];
|
|
231
|
+
/** The words of each bind group, so one is made again when a texture it names is made again. */
|
|
232
|
+
bindGroupWords = [];
|
|
233
|
+
/**
|
|
234
|
+
* A group that names the old view reads the new texture from its next set on. The set compares
|
|
235
|
+
* the group's epoch with the texture's, so a frame that makes no group again pays one compare.
|
|
236
|
+
*/
|
|
237
|
+
textureEpoch = 0;
|
|
238
|
+
/** The texture epoch at which each bind group was made. */
|
|
239
|
+
bindGroupEpoch = [];
|
|
240
|
+
/**
|
|
241
|
+
* Each bundle's commands as the draw list recorded them, which `ExecuteBundles` replays into the
|
|
242
|
+
* render pass. The backend makes no native render bundles: Safari 26 encodes a bundle that holds
|
|
243
|
+
* an indirect draw again at every execution, which costs its GPU process milliseconds per frame.
|
|
244
|
+
*/
|
|
245
|
+
bundles = [];
|
|
246
|
+
/** Each indirect draw's own copy of its arguments, for the render passes that hold several. */
|
|
247
|
+
indirect;
|
|
248
|
+
/** `commandEncoder` as a function made once, for helpers that record commands outside a pass. */
|
|
249
|
+
openEncoder = () => this.commandEncoder();
|
|
250
|
+
pipelines;
|
|
251
|
+
/** Staging buffers for the uploads that writeBuffer copies slowly. */
|
|
252
|
+
staging;
|
|
253
|
+
canvasFormat;
|
|
254
|
+
/** Times the passes of each frame, while the page measures. */
|
|
255
|
+
timer;
|
|
256
|
+
/** Reads back what the draws culled on the GPU drew, while the page samples. */
|
|
257
|
+
culled;
|
|
258
|
+
/**
|
|
259
|
+
* True once a replay met an indirect draw, which is a draw that the GPU's culling wrote the
|
|
260
|
+
* count of. A page whose frames draw none has no count to read back, so it makes no counts
|
|
261
|
+
* module and fetches no part of the engine for one.
|
|
262
|
+
*/
|
|
263
|
+
culledDrawn = false;
|
|
264
|
+
/**
|
|
265
|
+
* The device shaders that load another module when a pipeline needs builds with other fixed
|
|
266
|
+
* bits. Without it, every pipeline's build must be in the shaders that the backend got.
|
|
267
|
+
*/
|
|
268
|
+
moreShaders;
|
|
269
|
+
/**
|
|
270
|
+
* What the replays since the last reset uploaded, the part that went through staging, drew and
|
|
271
|
+
* built, the other GPU objects they made, and the draw commands they skipped because their
|
|
272
|
+
* pipeline was still building. The triangles and instances are those of the draws that the CPU
|
|
273
|
+
* issued, without the indirect draws, whose counts the GPU writes.
|
|
274
|
+
*/
|
|
275
|
+
counts = {
|
|
276
|
+
uploadBytes: 0,
|
|
277
|
+
stagedBytes: 0,
|
|
278
|
+
drawCalls: 0,
|
|
279
|
+
dispatches: 0,
|
|
280
|
+
pipelines: 0,
|
|
281
|
+
objects: 0,
|
|
282
|
+
skippedDraws: 0,
|
|
283
|
+
triangles: 0,
|
|
284
|
+
instances: 0,
|
|
285
|
+
};
|
|
286
|
+
// Descriptors that every frame fills again, so replay allocates none of its own.
|
|
287
|
+
renderPass = new RenderPassSetup();
|
|
288
|
+
computePass = {};
|
|
289
|
+
copy = new TexelCopySetup();
|
|
290
|
+
samplerSetup = {};
|
|
291
|
+
/** The buffer that copies from 2D textures into 3D textures pass through, made on first use. */
|
|
292
|
+
copyBuffer;
|
|
293
|
+
/** Copy buffers that a larger one replaced, which commands not yet submitted may still read. */
|
|
294
|
+
retiredCopyBuffers = [];
|
|
295
|
+
/**
|
|
296
|
+
* Textures that a later creation replaced, with their bytes, which commands not yet submitted
|
|
297
|
+
* may still read. WebGPU forbids a submit that names a destroyed texture, and a frame recreates
|
|
298
|
+
* a data texture on the same id when the scene grows, so the old one goes only after this
|
|
299
|
+
* frame's submit. Its bytes stay in the total until the device frees it.
|
|
300
|
+
*/
|
|
301
|
+
retiredTextures = [];
|
|
302
|
+
/** Replaced textures whose work the GPU may still run, which a backend that stops frees. */
|
|
303
|
+
retiringTextures = [];
|
|
304
|
+
/** Where the bytes of `ReadBuffer` commands land, which the frame replay sets. */
|
|
305
|
+
readSink;
|
|
306
|
+
reads = new BufferReads();
|
|
307
|
+
/**
|
|
308
|
+
* `shaders` are the WGSL builds that the device loaded (`loadWgslShaders`). `routes` chooses
|
|
309
|
+
* between writeBuffer and the staging ring for mid-size uploads; by default it times both routes
|
|
310
|
+
* and takes the faster one. `images` holds the images that uploads read, which the thread that
|
|
311
|
+
* draws keeps across GPU devices; by default the backend has its own.
|
|
312
|
+
*/
|
|
313
|
+
constructor(device, context, canvasFormat, shaders, routes = new UploadRoutes(), images) {
|
|
314
|
+
this.device = device;
|
|
315
|
+
this.context = context;
|
|
316
|
+
this.routes = routes;
|
|
317
|
+
this.canvasFormat = canvasFormat;
|
|
318
|
+
this.pipelines = new Pipelines(device, shaders);
|
|
319
|
+
this.pipelines.prebuildMipmaps();
|
|
320
|
+
this.staging = new StagingRing(device, this.gpuMemory);
|
|
321
|
+
this.indirect = new IndirectArguments(device, this.gpuMemory);
|
|
322
|
+
this.images = images ?? new ImageTable();
|
|
323
|
+
this.ownsImages = !images;
|
|
324
|
+
this.joins = new JoinedBuilds(this.images.shaders);
|
|
325
|
+
this.images.warmGeneratorsWith((code) => {
|
|
326
|
+
const { environment, probes } = code;
|
|
327
|
+
return Promise.all([environment.prepare(device), probes.prepare(device)]);
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
format(code) {
|
|
331
|
+
if (code === G.FORMAT_NONE)
|
|
332
|
+
return undefined;
|
|
333
|
+
if (code === G.FORMAT_CANVAS)
|
|
334
|
+
return this.canvasFormat;
|
|
335
|
+
const format = TEXTURE_FORMATS[code];
|
|
336
|
+
if (!format)
|
|
337
|
+
throw new Error(`unknown texture format code ${code}`);
|
|
338
|
+
return format;
|
|
339
|
+
}
|
|
340
|
+
need(table, id, what) {
|
|
341
|
+
const value = table[id];
|
|
342
|
+
if (value === undefined)
|
|
343
|
+
throw new Error(`draw list names ${what} ${id}, which does not exist${this.replayWord < 0 ? '' : `, in command ${this.replayOp} at word ${this.replayWord}`}`);
|
|
344
|
+
return value;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Adds a bind group layout, which `CreateBindGroup` and templates then name by `id`. The id
|
|
348
|
+
* must be one that no engine layout has.
|
|
349
|
+
*/
|
|
350
|
+
defineLayout(id, label, entries) {
|
|
351
|
+
this.pipelines.defineLayout(id, label, entries);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Adds a render pipeline template, which `CreateRenderPipeline` then builds pipelines from. The
|
|
355
|
+
* id must be one that no engine template has.
|
|
356
|
+
*/
|
|
357
|
+
defineTemplate(id, template) {
|
|
358
|
+
this.pipelines.defineTemplate(id, template);
|
|
359
|
+
}
|
|
360
|
+
/** Hands the backend an image for `UploadImage` commands to copy from, under the draw list's id. */
|
|
361
|
+
setImage(id, image) {
|
|
362
|
+
this.images.set(id, image);
|
|
363
|
+
}
|
|
364
|
+
/** The texture the canvas shows this frame, or an offscreen target standing in for it. */
|
|
365
|
+
canvasTarget;
|
|
366
|
+
/**
|
|
367
|
+
* The color targets that resolved into the canvas, by id, and while a capture draws into a
|
|
368
|
+
* stand-in for the canvas, a texture of the same kind for each of them, which every pass of the
|
|
369
|
+
* capture draws into in its place. On the Galaxy S25 (Adreno 830), a multisampled color texture
|
|
370
|
+
* whose first resolve went into the canvas resolves nothing into any other texture, so the
|
|
371
|
+
* stand-in for the canvas stayed empty.
|
|
372
|
+
*/
|
|
373
|
+
canvasResolved = new Set();
|
|
374
|
+
resolveStandIns = new Map();
|
|
375
|
+
/** Ends a capture: the frames draw into the canvas again, and the capture's own targets go. */
|
|
376
|
+
endCapture() {
|
|
377
|
+
this.canvasTarget = undefined;
|
|
378
|
+
for (const [id, texture] of this.resolveStandIns) {
|
|
379
|
+
texture.destroy();
|
|
380
|
+
this.gpuMemory.addTextures(-this.textureSizes[id]);
|
|
381
|
+
}
|
|
382
|
+
this.resolveStandIns.clear();
|
|
383
|
+
}
|
|
384
|
+
/** The view that a render pass draws its color into, before it resolves into `resolveId`. */
|
|
385
|
+
colorView(id, resolveId) {
|
|
386
|
+
if (!this.canvasTarget) {
|
|
387
|
+
if (resolveId === 0)
|
|
388
|
+
this.canvasResolved.add(id);
|
|
389
|
+
return this.targetView(id);
|
|
390
|
+
}
|
|
391
|
+
if (!this.canvasResolved.has(id))
|
|
392
|
+
return this.targetView(id);
|
|
393
|
+
let standIn = this.resolveStandIns.get(id);
|
|
394
|
+
if (!standIn) {
|
|
395
|
+
const texture = this.need(this.textures, id, 'render target');
|
|
396
|
+
standIn = this.device.createTexture({
|
|
397
|
+
size: [texture.width, texture.height],
|
|
398
|
+
format: texture.format,
|
|
399
|
+
sampleCount: texture.sampleCount,
|
|
400
|
+
usage: texture.usage,
|
|
401
|
+
});
|
|
402
|
+
this.gpuMemory.addTextures(this.textureSizes[id]);
|
|
403
|
+
this.resolveStandIns.set(id, standIn);
|
|
404
|
+
}
|
|
405
|
+
return standIn.createView();
|
|
406
|
+
}
|
|
407
|
+
targetView(id) {
|
|
408
|
+
if (id === G.NO_TARGET)
|
|
409
|
+
return undefined;
|
|
410
|
+
if (id === 0) {
|
|
411
|
+
const texture = this.canvasTarget ?? this.context?.getCurrentTexture();
|
|
412
|
+
if (!texture)
|
|
413
|
+
throw new Error('no canvas target to draw into');
|
|
414
|
+
return texture.createView();
|
|
415
|
+
}
|
|
416
|
+
return this.need(this.targetViews, id, 'render target');
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Creates a texture with a view for bind groups, in the view dimension that compatibility mode
|
|
420
|
+
* fixes at creation, and a view to draw into when it has one layer and one mip level. A 3D
|
|
421
|
+
* texture's layers are its depth; every other kind is 2D, a cube's faces among its layers.
|
|
422
|
+
*/
|
|
423
|
+
createTexture(words, a) {
|
|
424
|
+
const id = words[a];
|
|
425
|
+
// A texture made again on its id leaves every group that names it reading an old view.
|
|
426
|
+
const replacing = this.textures[id] !== undefined;
|
|
427
|
+
this.releaseTexture(id);
|
|
428
|
+
if (replacing)
|
|
429
|
+
this.textureEpoch++;
|
|
430
|
+
const width = words[a + 1];
|
|
431
|
+
const height = words[a + 2];
|
|
432
|
+
const layers = words[a + 3];
|
|
433
|
+
const format = words[a + 4];
|
|
434
|
+
const usage = words[a + 5];
|
|
435
|
+
const samples = words[a + 6];
|
|
436
|
+
const mips = words[a + 7];
|
|
437
|
+
const dimension = lookUp(VIEW_DIMENSIONS, words[a + 8], 'view dimension');
|
|
438
|
+
const bound = (usage & G.TEXTURE_USAGE_TEXTURE_BINDING) !== 0;
|
|
439
|
+
const texture = this.device.createTexture({
|
|
440
|
+
dimension: dimension === '3d' ? '3d' : '2d',
|
|
441
|
+
size: [width, height, layers],
|
|
442
|
+
format: this.format(format),
|
|
443
|
+
usage,
|
|
444
|
+
sampleCount: samples,
|
|
445
|
+
mipLevelCount: mips,
|
|
446
|
+
textureBindingViewDimension: bound ? dimension : undefined,
|
|
447
|
+
});
|
|
448
|
+
this.textures[id] = texture;
|
|
449
|
+
this.formats[id] = format;
|
|
450
|
+
const bytes = textureBytes(format, width, height, layers, mips, samples, dimension === '3d');
|
|
451
|
+
this.textureSizes[id] = bytes;
|
|
452
|
+
this.gpuMemory.addTextures(bytes);
|
|
453
|
+
this.viewDimensions[id] = dimension;
|
|
454
|
+
if (bound)
|
|
455
|
+
this.bindingViews[id] = texture.createView({
|
|
456
|
+
dimension,
|
|
457
|
+
// A texture that a compute step writes keeps STORAGE_BINDING too, so a bind group can
|
|
458
|
+
// bind it as a storage texture: the exposure's texel is one such.
|
|
459
|
+
usage: G.TEXTURE_USAGE_TEXTURE_BINDING | (usage & G.TEXTURE_USAGE_STORAGE_BINDING),
|
|
460
|
+
});
|
|
461
|
+
// A view of a transient texture must keep all of the texture's usage.
|
|
462
|
+
if (usage & G.TEXTURE_USAGE_RENDER_ATTACHMENT && layers === 1 && mips === 1)
|
|
463
|
+
this.targetViews[id] = texture.createView({
|
|
464
|
+
dimension: '2d',
|
|
465
|
+
usage: usage & (G.TEXTURE_USAGE_RENDER_ATTACHMENT | G.TEXTURE_USAGE_TRANSIENT_ATTACHMENT),
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
/** A view of one mip level and one layer of a texture, to draw into. */
|
|
469
|
+
createView(words, a) {
|
|
470
|
+
const id = words[a];
|
|
471
|
+
this.releaseTexture(id);
|
|
472
|
+
this.targetViews[id] = this.need(this.textures, words[a + 1], 'texture').createView({
|
|
473
|
+
dimension: '2d',
|
|
474
|
+
usage: G.TEXTURE_USAGE_RENDER_ATTACHMENT,
|
|
475
|
+
baseMipLevel: words[a + 2],
|
|
476
|
+
mipLevelCount: 1,
|
|
477
|
+
baseArrayLayer: words[a + 3],
|
|
478
|
+
arrayLayerCount: 1,
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* A view of a range of one texture's array layers, for bind groups to name. The range keeps a
|
|
483
|
+
* compute pass's storage writes and its reads of the state before on separate subresources.
|
|
484
|
+
*/
|
|
485
|
+
createBindView(words, a) {
|
|
486
|
+
const id = words[a];
|
|
487
|
+
this.releaseTexture(id);
|
|
488
|
+
const base = words[a + 1];
|
|
489
|
+
const texture = this.need(this.textures, base, 'texture');
|
|
490
|
+
const dimension = this.viewDimensions[base];
|
|
491
|
+
if (!dimension || !this.bindingViews[base])
|
|
492
|
+
throw new Error(`texture ${base} has no view for bind groups`);
|
|
493
|
+
this.viewDimensions[id] = dimension;
|
|
494
|
+
this.bindingViews[id] = texture.createView({
|
|
495
|
+
dimension,
|
|
496
|
+
baseArrayLayer: words[a + 2],
|
|
497
|
+
arrayLayerCount: words[a + 3],
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
/** Clears a range of a texture's layers to zero, one layer at a time, outside the passes. */
|
|
501
|
+
clearTexture(words, a) {
|
|
502
|
+
const texture = this.need(this.textures, words[a], 'texture');
|
|
503
|
+
const base = words[a + 1];
|
|
504
|
+
const count = words[a + 2];
|
|
505
|
+
const encoder = this.commandEncoder();
|
|
506
|
+
for (let layer = 0; layer < count; layer++) {
|
|
507
|
+
const view = texture.createView({
|
|
508
|
+
dimension: '2d',
|
|
509
|
+
usage: G.TEXTURE_USAGE_RENDER_ATTACHMENT,
|
|
510
|
+
baseArrayLayer: base + layer,
|
|
511
|
+
arrayLayerCount: 1,
|
|
512
|
+
});
|
|
513
|
+
encoder
|
|
514
|
+
.beginRenderPass({
|
|
515
|
+
colorAttachments: [
|
|
516
|
+
{
|
|
517
|
+
view,
|
|
518
|
+
clearValue: { r: 0, g: 0, b: 0, a: 0 },
|
|
519
|
+
loadOp: 'clear',
|
|
520
|
+
storeOp: 'store',
|
|
521
|
+
},
|
|
522
|
+
],
|
|
523
|
+
})
|
|
524
|
+
.end();
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
/** Destroys a texture, or releases a view. */
|
|
528
|
+
releaseTexture(id) {
|
|
529
|
+
this.canvasResolved.delete(id);
|
|
530
|
+
const texture = this.textures[id];
|
|
531
|
+
if (texture) {
|
|
532
|
+
this.generators?.release(texture, this.gpuMemory);
|
|
533
|
+
// A command of the frame being recorded may still read it, so it goes after the submit.
|
|
534
|
+
// Its bytes leave the total when the device frees it.
|
|
535
|
+
this.retiredTextures.push({ texture, bytes: this.textureSizes[id] });
|
|
536
|
+
}
|
|
537
|
+
this.textures[id] = undefined;
|
|
538
|
+
this.bindingViews[id] = undefined;
|
|
539
|
+
this.viewDimensions[id] = undefined;
|
|
540
|
+
this.targetViews[id] = undefined;
|
|
541
|
+
this.mipChains[id] = undefined;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Records a copy between textures. Safari 26 drops a copy from a 2D texture into any slice of a
|
|
545
|
+
* 3D texture but the first, with no error, while copies through a buffer land. The backend
|
|
546
|
+
* cannot tell browsers apart, so every such copy goes through a buffer that the backend keeps.
|
|
547
|
+
*/
|
|
548
|
+
copyTexture(words, a) {
|
|
549
|
+
const copy = this.copy;
|
|
550
|
+
const source = this.need(this.textures, words[a], 'texture');
|
|
551
|
+
const id = words[a + 5];
|
|
552
|
+
const destination = this.need(this.textures, id, 'texture');
|
|
553
|
+
const width = words[a + 10];
|
|
554
|
+
const height = words[a + 11];
|
|
555
|
+
const layers = words[a + 12];
|
|
556
|
+
copy.setSource(source, words, a);
|
|
557
|
+
copy.setDestination(destination, words, a + 5);
|
|
558
|
+
copy.setSize(width, height, layers);
|
|
559
|
+
const encoder = this.commandEncoder();
|
|
560
|
+
if (destination.dimension !== '3d' || source.dimension === '3d') {
|
|
561
|
+
encoder.copyTextureToTexture(copy.source, copy.destination, copy.size);
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
const block = G.FORMAT_BLOCK_SIZE[this.formats[id]] ?? 1;
|
|
565
|
+
const rows = Math.ceil(height / block);
|
|
566
|
+
const rowBytes = Math.ceil(width / block) * this.blockBytes(id);
|
|
567
|
+
const bytesPerRow = Math.ceil(rowBytes / ROW_ALIGNMENT) * ROW_ALIGNMENT;
|
|
568
|
+
const bytes = bytesPerRow * rows * layers;
|
|
569
|
+
if (!this.copyBuffer || this.copyBuffer.size < bytes) {
|
|
570
|
+
// A recorded copy may still read the smaller buffer, so it is destroyed only after the
|
|
571
|
+
// next submit, which WebGPU allows. Safari frees a buffer's memory only when destroyed.
|
|
572
|
+
if (this.copyBuffer)
|
|
573
|
+
this.retiredCopyBuffers.push(this.copyBuffer);
|
|
574
|
+
this.copyBuffer = this.device.createBuffer({
|
|
575
|
+
size: bytes,
|
|
576
|
+
usage: GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST,
|
|
577
|
+
});
|
|
578
|
+
this.gpuMemory.addBuffers(bytes);
|
|
579
|
+
}
|
|
580
|
+
copy.setVia(this.copyBuffer, bytesPerRow, rows);
|
|
581
|
+
encoder.copyTextureToBuffer(copy.source, copy.via, copy.size);
|
|
582
|
+
encoder.copyBufferToTexture(copy.via, copy.destination, copy.size);
|
|
583
|
+
}
|
|
584
|
+
/** Bytes of one block of texels of a texture: one texel unless its format is compressed. */
|
|
585
|
+
blockBytes(id) {
|
|
586
|
+
return G.FORMAT_BLOCK_BYTES[this.formats[id]] ?? 0;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Makes mip levels 1 and up of one layer of a texture array, a render pass per level. Each pass
|
|
590
|
+
* draws into its level of the layer, and reads the level before it through a view of every
|
|
591
|
+
* layer, as compatibility mode binds whole arrays only. The views, bind groups and pass
|
|
592
|
+
* descriptors stay with the texture, so a render target whose levels a frame makes in every
|
|
593
|
+
* frame makes none of them again. `levels` holds how many levels the image needs, or 0 for the
|
|
594
|
+
* texture's own count.
|
|
595
|
+
*/
|
|
596
|
+
generateMipmaps(id, layer, levels = 0) {
|
|
597
|
+
const texture = this.need(this.textures, id, 'texture');
|
|
598
|
+
const pipeline = this.pipelines.mipmaps(texture.format);
|
|
599
|
+
let chain = this.mipChains[id];
|
|
600
|
+
if (!chain || chain.layer !== layer || chain.pipeline !== pipeline)
|
|
601
|
+
chain = this.mipChains[id] = this.mipChain(texture, pipeline, layer);
|
|
602
|
+
const encoder = this.commandEncoder();
|
|
603
|
+
const count = levels === 0 ? texture.mipLevelCount : Math.min(levels, texture.mipLevelCount);
|
|
604
|
+
for (let level = 1; level < count; level++) {
|
|
605
|
+
const pass = encoder.beginRenderPass(chain.passes[level - 1]);
|
|
606
|
+
pass.setPipeline(pipeline);
|
|
607
|
+
pass.setBindGroup(0, chain.groups[level - 1]);
|
|
608
|
+
pass.draw(3, 1, 0, layer);
|
|
609
|
+
pass.end();
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Draws one layer of a source texture into the first texels of one layer of a light's image,
|
|
614
|
+
* at a size of its own, then makes that layer's mip levels: a spot light's picture that a
|
|
615
|
+
* sketch set as a texture. The image's corner is the smallest `size` by `size` texels of the
|
|
616
|
+
* layer, which the light tables' shaders read, so a source larger than the corner is reduced.
|
|
617
|
+
* The scale pipeline takes the image's size and the source's layer in its first instance.
|
|
618
|
+
*/
|
|
619
|
+
copyIntoImage(words, a) {
|
|
620
|
+
const sourceId = words[a];
|
|
621
|
+
const sourceLayer = words[a + 1];
|
|
622
|
+
const destId = words[a + 2];
|
|
623
|
+
const destLayer = words[a + 3];
|
|
624
|
+
const size = words[a + 4];
|
|
625
|
+
const levels = words[a + 5];
|
|
626
|
+
const source = this.need(this.textures, sourceId, 'texture');
|
|
627
|
+
const dest = this.need(this.textures, destId, 'texture');
|
|
628
|
+
const pipeline = this.pipelines.mipScale(dest.format);
|
|
629
|
+
this.mipSampler ??= this.device.createSampler({ magFilter: 'linear', minFilter: 'linear' });
|
|
630
|
+
const sourceView = source.createView({
|
|
631
|
+
dimension: '2d-array',
|
|
632
|
+
baseMipLevel: 0,
|
|
633
|
+
mipLevelCount: 1,
|
|
634
|
+
usage: G.TEXTURE_USAGE_TEXTURE_BINDING,
|
|
635
|
+
});
|
|
636
|
+
const group = this.device.createBindGroup({
|
|
637
|
+
layout: pipeline.getBindGroupLayout(0),
|
|
638
|
+
entries: [
|
|
639
|
+
{ binding: 0, resource: sourceView },
|
|
640
|
+
{ binding: 1, resource: this.mipSampler },
|
|
641
|
+
],
|
|
642
|
+
});
|
|
643
|
+
const target = dest.createView({
|
|
644
|
+
dimension: '2d',
|
|
645
|
+
baseMipLevel: 0,
|
|
646
|
+
mipLevelCount: 1,
|
|
647
|
+
baseArrayLayer: destLayer,
|
|
648
|
+
arrayLayerCount: 1,
|
|
649
|
+
usage: G.TEXTURE_USAGE_RENDER_ATTACHMENT,
|
|
650
|
+
});
|
|
651
|
+
const pass = this.commandEncoder().beginRenderPass({
|
|
652
|
+
colorAttachments: [{ view: target, loadOp: 'clear', storeOp: 'store' }],
|
|
653
|
+
});
|
|
654
|
+
pass.setPipeline(pipeline);
|
|
655
|
+
pass.setBindGroup(0, group);
|
|
656
|
+
pass.setScissorRect(0, 0, size, size);
|
|
657
|
+
pass.draw(3, 1, 0, size | (sourceLayer << SCALE_SIZE_BITS));
|
|
658
|
+
pass.end();
|
|
659
|
+
this.generateMipmaps(destId, destLayer, levels);
|
|
660
|
+
}
|
|
661
|
+
/** What making the levels of one layer of a texture with `pipeline` draws with, level by level. */
|
|
662
|
+
mipChain(texture, pipeline, layer) {
|
|
663
|
+
this.mipSampler ??= this.device.createSampler({ magFilter: 'linear', minFilter: 'linear' });
|
|
664
|
+
const chain = { layer, pipeline, groups: [], passes: [] };
|
|
665
|
+
for (let level = 1; level < texture.mipLevelCount; level++) {
|
|
666
|
+
const source = texture.createView({
|
|
667
|
+
dimension: '2d-array',
|
|
668
|
+
baseMipLevel: level - 1,
|
|
669
|
+
mipLevelCount: 1,
|
|
670
|
+
usage: G.TEXTURE_USAGE_TEXTURE_BINDING,
|
|
671
|
+
});
|
|
672
|
+
chain.groups.push(this.device.createBindGroup({
|
|
673
|
+
layout: pipeline.getBindGroupLayout(0),
|
|
674
|
+
entries: [
|
|
675
|
+
{ binding: 0, resource: source },
|
|
676
|
+
{ binding: 1, resource: this.mipSampler },
|
|
677
|
+
],
|
|
678
|
+
}));
|
|
679
|
+
const target = texture.createView({
|
|
680
|
+
dimension: '2d',
|
|
681
|
+
baseMipLevel: level,
|
|
682
|
+
mipLevelCount: 1,
|
|
683
|
+
baseArrayLayer: layer,
|
|
684
|
+
arrayLayerCount: 1,
|
|
685
|
+
usage: G.TEXTURE_USAGE_RENDER_ATTACHMENT,
|
|
686
|
+
});
|
|
687
|
+
chain.passes.push({
|
|
688
|
+
colorAttachments: [{ view: target, loadOp: 'clear', storeOp: 'store' }],
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
return chain;
|
|
692
|
+
}
|
|
693
|
+
/** The generators' code once a generator ran, which frees a sky map with its texture. */
|
|
694
|
+
generators;
|
|
695
|
+
/**
|
|
696
|
+
* Runs a generator that the table holds on a cube texture: the whole map in one submit, ahead
|
|
697
|
+
* of the frame's commands, which never write the texture, or one stage of a sky map in the
|
|
698
|
+
* frame's commands, ahead of its passes. A sky map's stages before the last write only what the
|
|
699
|
+
* generator keeps, so frames draw with the map as it was until the last copies the new levels in.
|
|
700
|
+
*/
|
|
701
|
+
generateTexture(op, words, floats, a) {
|
|
702
|
+
const texture = this.need(this.textures, words[a], 'texture');
|
|
703
|
+
const id = words[a + 1];
|
|
704
|
+
const code = this.images.generatorCodeFor(id).environment;
|
|
705
|
+
this.generators = code;
|
|
706
|
+
if (op === G.OP_SKY_MAP_STEP) {
|
|
707
|
+
const panorama = words[a + 3];
|
|
708
|
+
const source = panorama === 0 ? undefined : this.need(this.textures, panorama, 'texture');
|
|
709
|
+
// The cloud tier's noise field exists once the tier's first frame made it, and the
|
|
710
|
+
// generator reads it only while the tier draws.
|
|
711
|
+
const cloudSteps = words[a + CLOUD_STEPS_WORD];
|
|
712
|
+
const field = words[a + CLOUD_FIELD_WORD];
|
|
713
|
+
const noise = cloudSteps > 0 && field !== 0 ? this.need(this.textures, field, 'texture') : undefined;
|
|
714
|
+
// The page's sky layer, once its shader is here: the map's texels then hold the layer
|
|
715
|
+
// that the background shows, and so do the reflections and the light taken from them.
|
|
716
|
+
const template = words[a + LAYER_WORD];
|
|
717
|
+
const layer = template === 0
|
|
718
|
+
? undefined
|
|
719
|
+
: variantFor(this.images.shaders.get(template)?.variants ?? {}, 0, 'wgsl');
|
|
720
|
+
const capture = words[a + LIGHT_BUFFER_WORD];
|
|
721
|
+
// A capture draws the frame again to read it back, and the light capture already ran in
|
|
722
|
+
// the frame that it draws again: a second draw would write a buffer whose read is still
|
|
723
|
+
// mapping it, which the device refuses.
|
|
724
|
+
const readback = capture === 0 || this.canvasTarget ? undefined : this.need(this.buffers, capture, 'buffer');
|
|
725
|
+
const encoder = this.commandEncoder();
|
|
726
|
+
code.skyStage(this.device, encoder, texture, words, floats, a, this.gpuMemory, source, layer, readback, noise);
|
|
727
|
+
}
|
|
728
|
+
else
|
|
729
|
+
code.run(this.device, texture, this.images.generator(id)[0]);
|
|
730
|
+
}
|
|
731
|
+
/** The six capture views' images of the probe that a filter makes, kept so it allocates none. */
|
|
732
|
+
probeFaces = [];
|
|
733
|
+
/**
|
|
734
|
+
* Makes a reflection probe's map from its six capture views' images, in the frame's commands,
|
|
735
|
+
* ahead of its passes, with the filter of the generators' code under the command's image id.
|
|
736
|
+
*/
|
|
737
|
+
filterProbe(words, a) {
|
|
738
|
+
const probes = this.need(this.textures, words[a], 'texture');
|
|
739
|
+
const chain = this.need(this.textures, words[a + 1], 'texture');
|
|
740
|
+
const code = this.images.generatorCodeFor(words[a + 3]).probes;
|
|
741
|
+
for (let face = 0; face < 6; face++)
|
|
742
|
+
this.probeFaces[face] = this.need(this.textures, words[a + 4 + face], 'texture');
|
|
743
|
+
const layer = words[a + 2];
|
|
744
|
+
code.run(this.device, this.commandEncoder(), probes, chain, layer, this.probeFaces, this.gpuMemory);
|
|
745
|
+
}
|
|
746
|
+
createSampler(words, floats, a) {
|
|
747
|
+
const setup = this.samplerSetup;
|
|
748
|
+
setup.addressModeU = lookUp(ADDRESS_MODES, words[a + 1], 'address mode');
|
|
749
|
+
setup.addressModeV = lookUp(ADDRESS_MODES, words[a + 2], 'address mode');
|
|
750
|
+
setup.addressModeW = lookUp(ADDRESS_MODES, words[a + 3], 'address mode');
|
|
751
|
+
setup.magFilter = lookUp(FILTERS, words[a + 4], 'filter');
|
|
752
|
+
setup.minFilter = lookUp(FILTERS, words[a + 5], 'filter');
|
|
753
|
+
setup.mipmapFilter = lookUp(FILTERS, words[a + 6], 'filter');
|
|
754
|
+
setup.lodMinClamp = floats[a + 7];
|
|
755
|
+
setup.lodMaxClamp = floats[a + 8];
|
|
756
|
+
const compare = words[a + 9];
|
|
757
|
+
setup.compare =
|
|
758
|
+
compare === G.COMPARE_NONE
|
|
759
|
+
? undefined
|
|
760
|
+
: lookUp(COMPARE_FUNCTIONS, compare, 'compare function');
|
|
761
|
+
setup.maxAnisotropy = words[a + 10];
|
|
762
|
+
this.samplers[words[a]] = this.device.createSampler(setup);
|
|
763
|
+
}
|
|
764
|
+
encoder;
|
|
765
|
+
/**
|
|
766
|
+
* The frame's encoder, with the staged uploads recorded ahead of the command about to go in. A
|
|
767
|
+
* new encoder opens with the GPU timer's start mark when the timer times the frame.
|
|
768
|
+
*/
|
|
769
|
+
commandEncoder() {
|
|
770
|
+
if (!this.encoder) {
|
|
771
|
+
this.encoder = this.device.createCommandEncoder();
|
|
772
|
+
this.timer?.markStart(this.encoder);
|
|
773
|
+
}
|
|
774
|
+
if (this.staging.pending) {
|
|
775
|
+
const start = this.routes.timing ? performance.now() : 0;
|
|
776
|
+
this.staging.flush(this.encoder);
|
|
777
|
+
if (this.routes.timing)
|
|
778
|
+
this.routes.ringWork(performance.now() - start);
|
|
779
|
+
}
|
|
780
|
+
return this.encoder;
|
|
781
|
+
}
|
|
782
|
+
submit() {
|
|
783
|
+
if (!this.encoder && !this.staging.pending)
|
|
784
|
+
return;
|
|
785
|
+
const encoder = this.commandEncoder();
|
|
786
|
+
this.timer?.endFrame();
|
|
787
|
+
this.culled?.copy(encoder);
|
|
788
|
+
submitOne(this.device.queue, encoder.finish());
|
|
789
|
+
if (this.retiredCopyBuffers.length > 0)
|
|
790
|
+
this.destroyRetired();
|
|
791
|
+
if (this.retiredTextures.length > 0)
|
|
792
|
+
this.destroyRetiredTextures();
|
|
793
|
+
const start = this.routes.timing ? performance.now() : 0;
|
|
794
|
+
this.staging.afterSubmit();
|
|
795
|
+
if (this.routes.timing)
|
|
796
|
+
this.routes.ringWork(performance.now() - start);
|
|
797
|
+
this.routes.submitted(this.staging.takeMadeBuffer());
|
|
798
|
+
this.encoder = undefined;
|
|
799
|
+
this.timer?.afterSubmit();
|
|
800
|
+
this.culled?.afterSubmit();
|
|
801
|
+
}
|
|
802
|
+
/** Destroys the copy buffers that a larger one replaced, once their commands are submitted. */
|
|
803
|
+
destroyRetired() {
|
|
804
|
+
for (const buffer of this.retiredCopyBuffers)
|
|
805
|
+
this.destroyBuffer(buffer);
|
|
806
|
+
this.retiredCopyBuffers.length = 0;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Destroys the textures that a later creation replaced, once the GPU has finished the work that
|
|
810
|
+
* named them. A command buffer already handed to the queue keeps the texture it names, so the
|
|
811
|
+
* device frees it only after that work completes.
|
|
812
|
+
*/
|
|
813
|
+
destroyRetiredTextures() {
|
|
814
|
+
if (this.retiredTextures.length === 0)
|
|
815
|
+
return;
|
|
816
|
+
const retiring = this.retiredTextures.splice(0);
|
|
817
|
+
this.retiringTextures.push(...retiring);
|
|
818
|
+
void this.device.queue.onSubmittedWorkDone().then(() => {
|
|
819
|
+
for (const entry of retiring) {
|
|
820
|
+
// A backend that stopped has already freed these, and counts their bytes once.
|
|
821
|
+
const at = this.retiringTextures.indexOf(entry);
|
|
822
|
+
if (at < 0)
|
|
823
|
+
continue;
|
|
824
|
+
this.retiringTextures.splice(at, 1);
|
|
825
|
+
entry.texture.destroy();
|
|
826
|
+
this.gpuMemory.addTextures(-entry.bytes);
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
resetCounts() {
|
|
831
|
+
this.counts.uploadBytes = 0;
|
|
832
|
+
this.counts.stagedBytes = 0;
|
|
833
|
+
this.counts.drawCalls = 0;
|
|
834
|
+
this.counts.dispatches = 0;
|
|
835
|
+
this.counts.pipelines = 0;
|
|
836
|
+
this.counts.objects = 0;
|
|
837
|
+
this.counts.skippedDraws = 0;
|
|
838
|
+
this.counts.triangles = 0;
|
|
839
|
+
this.counts.instances = 0;
|
|
840
|
+
}
|
|
841
|
+
/** Counts a draw of `count` vertices or indices, `instances` times, with the current pipeline. */
|
|
842
|
+
countDraw(count, instances) {
|
|
843
|
+
this.counts.drawCalls++;
|
|
844
|
+
this.counts.instances += instances;
|
|
845
|
+
if (!this.lines)
|
|
846
|
+
this.counts.triangles += Math.floor(count / 3) * instances;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Starts to build each pipeline that the list in `words[start, end)` creates before its first
|
|
850
|
+
* other command, and returns where the rest of the list starts. The builds run without
|
|
851
|
+
* blocking. Until a pipeline is built, `building` is true and the draws that use it draw
|
|
852
|
+
* nothing.
|
|
853
|
+
*/
|
|
854
|
+
prepare(words, start, end) {
|
|
855
|
+
this.replayWord = -1;
|
|
856
|
+
let i = start;
|
|
857
|
+
while (i < end) {
|
|
858
|
+
const header = words[i];
|
|
859
|
+
const op = header & 0xff;
|
|
860
|
+
if (op !== G.OP_CREATE_RENDER_PIPELINE && op !== G.OP_CREATE_COMPUTE_PIPELINE)
|
|
861
|
+
break;
|
|
862
|
+
this.listing.add(op, words, i + 1);
|
|
863
|
+
this.createPipeline(op, words, i + 1, true);
|
|
864
|
+
i += header >>> 8;
|
|
865
|
+
}
|
|
866
|
+
if (this.listing.active)
|
|
867
|
+
this.buildAhead(words, i, end);
|
|
868
|
+
return i;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Starts to build, in the background, each pipeline that the list in `words[start, end)` creates
|
|
872
|
+
* after other commands, such as an add-on's compute pass. The frame before the first one then
|
|
873
|
+
* waits for them, as for the pipelines at the list's front, and its replay takes them. Without
|
|
874
|
+
* this, its replay would build each at once, and the GPU would compile them one after another
|
|
875
|
+
* inside the first frame.
|
|
876
|
+
*/
|
|
877
|
+
buildAhead(words, start, end) {
|
|
878
|
+
for (let i = start; i < end;) {
|
|
879
|
+
const header = words[i];
|
|
880
|
+
const length = header >>> 8;
|
|
881
|
+
if (length === 0)
|
|
882
|
+
return;
|
|
883
|
+
const op = header & 0xff;
|
|
884
|
+
const id = words[i + 1];
|
|
885
|
+
if ((op === G.OP_CREATE_RENDER_PIPELINE || op === G.OP_CREATE_COMPUTE_PIPELINE) &&
|
|
886
|
+
!this.ahead.has(id)) {
|
|
887
|
+
const key = keyOf(op, words, i + 1);
|
|
888
|
+
let build = this.aheadByKey.get(key);
|
|
889
|
+
if (!build) {
|
|
890
|
+
build = this.early?.take(op, words, i + 1) ?? this.startAhead(op, words, i + 1);
|
|
891
|
+
if (build) {
|
|
892
|
+
this.aheadByKey.set(key, build);
|
|
893
|
+
this.builds++;
|
|
894
|
+
build.done
|
|
895
|
+
.then(() => undefined, () => undefined)
|
|
896
|
+
.finally(() => {
|
|
897
|
+
this.builds--;
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
if (build)
|
|
902
|
+
this.ahead.set(id, { key, build });
|
|
903
|
+
}
|
|
904
|
+
i += length;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* The background build of the create command `op` whose operands start at `a`, or undefined
|
|
909
|
+
* while its shader has not arrived or when it builds when its command comes.
|
|
910
|
+
*/
|
|
911
|
+
startAhead(op, words, a) {
|
|
912
|
+
const template = words[a + 1];
|
|
913
|
+
const permutation = words[a + 2];
|
|
914
|
+
let done;
|
|
915
|
+
try {
|
|
916
|
+
if (op === G.OP_CREATE_COMPUTE_PIPELINE) {
|
|
917
|
+
if (!this.computeReady(template, permutation))
|
|
918
|
+
return undefined;
|
|
919
|
+
done = this.device.createComputePipelineAsync(this.pipelines.compute(template, permutation));
|
|
920
|
+
}
|
|
921
|
+
else {
|
|
922
|
+
if (this.joins.joined(template) || !this.templateReady(template, permutation))
|
|
923
|
+
return undefined;
|
|
924
|
+
done = this.device.createRenderPipelineAsync(this.renderDescriptor(words, a));
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
catch {
|
|
928
|
+
return undefined;
|
|
929
|
+
}
|
|
930
|
+
const made = {
|
|
931
|
+
pipeline: undefined,
|
|
932
|
+
failed: false,
|
|
933
|
+
done,
|
|
934
|
+
};
|
|
935
|
+
done.then((pipeline) => {
|
|
936
|
+
made.pipeline = pipeline;
|
|
937
|
+
}, () => {
|
|
938
|
+
made.failed = true;
|
|
939
|
+
});
|
|
940
|
+
return made;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* The built pipeline of a create command that the list creates after other commands, whose build
|
|
944
|
+
* started when the list was prepared, or undefined when there is none, as after the first frame.
|
|
945
|
+
*/
|
|
946
|
+
takeAhead(op, words, a) {
|
|
947
|
+
if (this.ahead.size === 0)
|
|
948
|
+
return undefined;
|
|
949
|
+
const id = words[a];
|
|
950
|
+
const ahead = this.ahead.get(id);
|
|
951
|
+
if (!ahead)
|
|
952
|
+
return undefined;
|
|
953
|
+
this.ahead.delete(id);
|
|
954
|
+
return ahead.key === keyOf(op, words, a) ? ahead.build.pipeline : undefined;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Where the draw section of the list in `words[start, end)` begins, after the pipelines it
|
|
958
|
+
* creates. It walks the same ops as `prepare` and starts no build.
|
|
959
|
+
*/
|
|
960
|
+
restStart(words, start, end) {
|
|
961
|
+
let i = start;
|
|
962
|
+
while (i < end) {
|
|
963
|
+
const header = words[i];
|
|
964
|
+
const op = header & 0xff;
|
|
965
|
+
if (op !== G.OP_CREATE_RENDER_PIPELINE && op !== G.OP_CREATE_COMPUTE_PIPELINE)
|
|
966
|
+
break;
|
|
967
|
+
i += header >>> 8;
|
|
968
|
+
}
|
|
969
|
+
return i;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* True while a pipeline is building. Pipelines whose shaders arrived start to build first, and
|
|
973
|
+
* so do those of custom materials whose shader a hot update replaced.
|
|
974
|
+
*/
|
|
975
|
+
get building() {
|
|
976
|
+
if (DEV && this.images.replaced.length > 0)
|
|
977
|
+
this.swapReplaced();
|
|
978
|
+
if (this.parked.length > 0 || this.parkedCompute.length > 0)
|
|
979
|
+
this.unpark();
|
|
980
|
+
if (this.retries.length > 0 && this.running === 0)
|
|
981
|
+
this.retryRefused();
|
|
982
|
+
return this.builds > 0;
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Builds each pipeline of a custom material whose shader a hot update replaced again, in the
|
|
986
|
+
* background. The old pipeline draws until the new one is built, so no frame loses the
|
|
987
|
+
* material's objects. A pipeline that fails to build keeps the old one and logs why.
|
|
988
|
+
*/
|
|
989
|
+
swapReplaced() {
|
|
990
|
+
if (!DEV)
|
|
991
|
+
return;
|
|
992
|
+
for (const template of this.images.replaced.splice(0)) {
|
|
993
|
+
const shader = this.images.shaders.get(template);
|
|
994
|
+
// A template that no pipeline has used takes the new shader at its first use.
|
|
995
|
+
if (!shader || !this.pipelines.has(template))
|
|
996
|
+
continue;
|
|
997
|
+
this.pipelines.replaceCustom(template, shader);
|
|
998
|
+
for (const [id, operands] of this.customOperands) {
|
|
999
|
+
if (operands[1] !== template)
|
|
1000
|
+
continue;
|
|
1001
|
+
const swap = ++this.swapCount;
|
|
1002
|
+
this.swaps.set(id, swap);
|
|
1003
|
+
this.builds++;
|
|
1004
|
+
this.running++;
|
|
1005
|
+
this.counts.pipelines++;
|
|
1006
|
+
const keep = (error) => console.error(`null3D could not build the new WGSL of a custom material on this GPU, so its objects keep the old shader: ${messageOf(error)}`);
|
|
1007
|
+
Promise.resolve()
|
|
1008
|
+
.then(() => this.device.createRenderPipelineAsync(this.renderDescriptor(operands, 0)))
|
|
1009
|
+
.then((pipeline) => {
|
|
1010
|
+
// A pipeline destroyed meanwhile stays gone, and a later swap wins.
|
|
1011
|
+
if (this.swaps.get(id) === swap)
|
|
1012
|
+
this.renderPipelines[id] = pipeline;
|
|
1013
|
+
}, keep)
|
|
1014
|
+
.finally(() => {
|
|
1015
|
+
this.builds--;
|
|
1016
|
+
this.running--;
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* True when a render pipeline template can build a pipeline of `permutation` now: an engine
|
|
1023
|
+
* template whose build for it is loaded, or a custom material's whose shader arrived, which it
|
|
1024
|
+
* defines at its first use, once the set of its builds that holds the build has arrived too. A
|
|
1025
|
+
* group's or a fold's shader is joined then too, once its host's file has arrived.
|
|
1026
|
+
*/
|
|
1027
|
+
templateReady(template, permutation) {
|
|
1028
|
+
if (!this.pipelines.has(template)) {
|
|
1029
|
+
const shader = this.images.shaders.get(template);
|
|
1030
|
+
if (!shader || !joinedReady(shader, this.images.shaders, this.moreShaders, 'wgsl'))
|
|
1031
|
+
return false;
|
|
1032
|
+
this.pipelines.defineCustom(template, shader);
|
|
1033
|
+
}
|
|
1034
|
+
if (!this.images.buildsReady(template, permutation, 'wgsl'))
|
|
1035
|
+
return false;
|
|
1036
|
+
return this.moreShaders?.ready(this.pipelines.variants(template), permutation, 'wgsl') ?? true;
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Prepares the shaders of `module`, a module that the page or the sketch preloaded, whose builds
|
|
1040
|
+
* need `features`: it creates each build's shader module, which the features' pipelines then
|
|
1041
|
+
* share, and builds the compute pipelines of skinning and occlusion culling, whose layouts are
|
|
1042
|
+
* fixed, from the module of that one feature. A render
|
|
1043
|
+
* pipeline also needs the targets, the vertex format and the state of the objects that draw with
|
|
1044
|
+
* it, which the scene gives, so `scene.warmUp()` builds those. Skinning's file holds the SKIN
|
|
1045
|
+
* builds, which skin in the vertex shader, and the skinning pass, which morphs and skins what
|
|
1046
|
+
* they cannot. It builds the pass's pipelines in every mode, and prepares the SKIN builds only
|
|
1047
|
+
* while the vertex shaders skin.
|
|
1048
|
+
*/
|
|
1049
|
+
precompile(features, module) {
|
|
1050
|
+
const [feature, ...others] = features;
|
|
1051
|
+
const compute = feature !== undefined && others.length === 0 ? PRECOMPILED[feature] : undefined;
|
|
1052
|
+
if (!compute || (feature === 'skinning' && this.skinsInVertexShaders))
|
|
1053
|
+
for (const [name, builds] of Object.entries(module))
|
|
1054
|
+
for (const build of Object.values(builds))
|
|
1055
|
+
if (build.wgsl)
|
|
1056
|
+
this.pipelines.prepareModule(name, build.wgsl);
|
|
1057
|
+
for (const [template, bits] of compute ?? [])
|
|
1058
|
+
this.device
|
|
1059
|
+
.createComputePipelineAsync(this.pipelines.compute(template, bits))
|
|
1060
|
+
.catch(() => undefined);
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Starts to build the pipelines of `list`, a pipeline list of the pipelines that the first frame
|
|
1064
|
+
* of the sketch's last start built (`gpu/early-builds.ts`). Each build starts once its shader is
|
|
1065
|
+
* there, and a create command of the same pipeline takes it. A joined shader's pipelines build
|
|
1066
|
+
* when their command comes, as their failure sends the effects back to a pass each.
|
|
1067
|
+
*/
|
|
1068
|
+
buildEarly(list) {
|
|
1069
|
+
this.early?.stop();
|
|
1070
|
+
this.early = new EarlyBuilds(list, (op, operands) => {
|
|
1071
|
+
const template = operands[1];
|
|
1072
|
+
const permutation = operands[2];
|
|
1073
|
+
if (op === G.OP_CREATE_COMPUTE_PIPELINE) {
|
|
1074
|
+
if (!this.computeReady(template, permutation))
|
|
1075
|
+
return undefined;
|
|
1076
|
+
return this.device.createComputePipelineAsync(this.pipelines.compute(template, permutation));
|
|
1077
|
+
}
|
|
1078
|
+
if (this.joins.joined(template))
|
|
1079
|
+
return null;
|
|
1080
|
+
if (!this.templateReady(template, permutation))
|
|
1081
|
+
return undefined;
|
|
1082
|
+
return this.device.createRenderPipelineAsync(this.renderDescriptor(operands, 0));
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Ends the list of the pipelines that the frames before the first one created, and returns it,
|
|
1087
|
+
* once: the first frame has drawn. The builds of the last start's list that no command took
|
|
1088
|
+
* stop.
|
|
1089
|
+
*/
|
|
1090
|
+
takeListing() {
|
|
1091
|
+
this.early?.stop();
|
|
1092
|
+
this.early = undefined;
|
|
1093
|
+
this.ahead.clear();
|
|
1094
|
+
this.aheadByKey.clear();
|
|
1095
|
+
return this.listing.take();
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Gives the pipeline `id` of `table` the build that started for it ahead of its command: at once
|
|
1099
|
+
* when it is built, else when it is.
|
|
1100
|
+
*/
|
|
1101
|
+
adopt(table, id, early) {
|
|
1102
|
+
const pipeline = early.pipeline;
|
|
1103
|
+
if (pipeline) {
|
|
1104
|
+
table[id] = pipeline;
|
|
1105
|
+
return;
|
|
1106
|
+
}
|
|
1107
|
+
table[id] = null;
|
|
1108
|
+
this.builds++;
|
|
1109
|
+
early.done.then((built) => this.built(table, id, built), (error) => this.failed(error));
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Makes the skinning pass write normals and tangents as 32-bit floats, as the core's skinned
|
|
1113
|
+
* vertices hold them in the skinning modes that measure 8-bit ones against floats.
|
|
1114
|
+
*/
|
|
1115
|
+
skinWithFloatDirections() {
|
|
1116
|
+
this.pipelines.floatSkinnedDirections = true;
|
|
1117
|
+
}
|
|
1118
|
+
/** True when a compute template's shader is loaded: one that loads on first use, once its file arrives. */
|
|
1119
|
+
computeReady(template, permutation) {
|
|
1120
|
+
// An add-on's compute pass brings its own whole shader, which the sketch sent before the
|
|
1121
|
+
// frame that first creates its pipeline. The template is defined once that shader arrives,
|
|
1122
|
+
// and until then its pipeline waits.
|
|
1123
|
+
const custom = this.images.shaders.get(template);
|
|
1124
|
+
if (custom?.kind === 'compute') {
|
|
1125
|
+
if (!this.pipelines.has(template))
|
|
1126
|
+
this.pipelines.defineCustom(template, custom);
|
|
1127
|
+
return true;
|
|
1128
|
+
}
|
|
1129
|
+
if (template >= SHADING_CUSTOM_FIRST)
|
|
1130
|
+
return false;
|
|
1131
|
+
const variants = this.pipelines.computeVariants(template, permutation);
|
|
1132
|
+
return (variants === undefined || (this.moreShaders?.ready(variants, permutation, 'wgsl') ?? true));
|
|
1133
|
+
}
|
|
1134
|
+
/** Starts to build each parked pipeline whose shader has arrived. */
|
|
1135
|
+
unpark() {
|
|
1136
|
+
this.unparkEach(this.parked, G.OP_CREATE_RENDER_PIPELINE, (operands) => this.templateReady(operands[1], operands[2]));
|
|
1137
|
+
this.unparkEach(this.parkedCompute, G.OP_CREATE_COMPUTE_PIPELINE, (operands) => this.computeReady(operands[1], operands[2]));
|
|
1138
|
+
}
|
|
1139
|
+
/** Starts to build each pipeline of `parked` that is `ready`, with the command `op`. */
|
|
1140
|
+
unparkEach(parked, op, ready) {
|
|
1141
|
+
for (let k = parked.length - 1; k >= 0; k--) {
|
|
1142
|
+
const operands = parked[k];
|
|
1143
|
+
if (!ready(operands))
|
|
1144
|
+
continue;
|
|
1145
|
+
parked.splice(k, 1);
|
|
1146
|
+
this.builds--;
|
|
1147
|
+
this.counts.pipelines--;
|
|
1148
|
+
this.createPipeline(op, operands, 0, true);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Creates the pipeline of a `CreateRenderPipeline` or `CreateComputePipeline` command with its
|
|
1153
|
+
* operands at `a`: in the background when `background` is set, else at once.
|
|
1154
|
+
*/
|
|
1155
|
+
createPipeline(op, words, a, background) {
|
|
1156
|
+
this.counts.pipelines++;
|
|
1157
|
+
const id = words[a];
|
|
1158
|
+
const device = this.device;
|
|
1159
|
+
if (op === G.OP_CREATE_COMPUTE_PIPELINE) {
|
|
1160
|
+
if (!this.computeReady(words[a + 1], words[a + 2])) {
|
|
1161
|
+
// Its dispatches do nothing until its shader file arrives and the pipeline builds.
|
|
1162
|
+
this.computePipelines[id] = null;
|
|
1163
|
+
this.builds++;
|
|
1164
|
+
this.parkedCompute.push(words.slice(a, a - 1 + (words[a - 1] >>> 8)));
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1167
|
+
const early = background ? this.early?.take(op, words, a) : undefined;
|
|
1168
|
+
if (early) {
|
|
1169
|
+
this.adopt(this.computePipelines, id, early);
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
if (!background) {
|
|
1173
|
+
this.computePipelines[id] =
|
|
1174
|
+
this.takeAhead(op, words, a) ??
|
|
1175
|
+
device.createComputePipeline(this.pipelines.compute(words[a + 1], words[a + 2]));
|
|
1176
|
+
return;
|
|
1177
|
+
}
|
|
1178
|
+
const descriptor = this.pipelines.compute(words[a + 1], words[a + 2]);
|
|
1179
|
+
this.computePipelines[id] = null;
|
|
1180
|
+
this.builds++;
|
|
1181
|
+
this.running++;
|
|
1182
|
+
device.createComputePipelineAsync(descriptor).then((pipeline) => {
|
|
1183
|
+
this.running--;
|
|
1184
|
+
this.built(this.computePipelines, id, pipeline);
|
|
1185
|
+
}, (error) => {
|
|
1186
|
+
this.running--;
|
|
1187
|
+
this.failed(error);
|
|
1188
|
+
});
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
this.lineLists[id] = (words[a + 6] & G.STATE_LINE_LIST) !== 0;
|
|
1192
|
+
if (!this.templateReady(words[a + 1], words[a + 2])) {
|
|
1193
|
+
// Its draws draw nothing until the shader arrives and the pipeline builds.
|
|
1194
|
+
this.renderPipelines[id] = null;
|
|
1195
|
+
this.builds++;
|
|
1196
|
+
// The command's header, before its operands, gives its length in words.
|
|
1197
|
+
this.parked.push(words.slice(a, a - 1 + (words[a - 1] >>> 8)));
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
// A joined shader always builds in the background, so a frame never waits for it and its
|
|
1201
|
+
// failure only sends its effects back to a pass each.
|
|
1202
|
+
const template = words[a + 1];
|
|
1203
|
+
const joined = this.joins.joined(template);
|
|
1204
|
+
if (DEV && !joined && this.images.shaders.has(template))
|
|
1205
|
+
this.customOperands.set(id, words.slice(a, a + RENDER_PIPELINE_OPERANDS));
|
|
1206
|
+
const early = background && !joined ? this.early?.take(op, words, a) : undefined;
|
|
1207
|
+
if (early) {
|
|
1208
|
+
this.adopt(this.renderPipelines, id, early);
|
|
1209
|
+
return;
|
|
1210
|
+
}
|
|
1211
|
+
if (!background && !joined) {
|
|
1212
|
+
this.renderPipelines[id] =
|
|
1213
|
+
this.takeAhead(op, words, a) ??
|
|
1214
|
+
device.createRenderPipeline(this.renderDescriptor(words, a));
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
const descriptor = this.renderDescriptor(words, a);
|
|
1218
|
+
this.renderPipelines[id] = null;
|
|
1219
|
+
this.builds++;
|
|
1220
|
+
this.running++;
|
|
1221
|
+
const start = performance.now();
|
|
1222
|
+
const permutation = words[a + 2];
|
|
1223
|
+
device.createRenderPipelineAsync(descriptor).then((pipeline) => {
|
|
1224
|
+
this.running--;
|
|
1225
|
+
if (joined)
|
|
1226
|
+
this.joins.built(template, performance.now() - start);
|
|
1227
|
+
this.built(this.renderPipelines, id, pipeline);
|
|
1228
|
+
}, (error) => {
|
|
1229
|
+
this.running--;
|
|
1230
|
+
if (!joined)
|
|
1231
|
+
return this.refusedOnce({ id, template, permutation, descriptor }, error);
|
|
1232
|
+
this.builds--;
|
|
1233
|
+
this.joins.failed(template, error);
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Hears that a render pipeline did not build. A pipeline of the scene's objects that the GPU's
|
|
1238
|
+
* driver refused waits for its retry, and still counts as building. Any other failure, such as
|
|
1239
|
+
* a descriptor that the browser's validation refused, is an engine fault, which the next replay
|
|
1240
|
+
* reports.
|
|
1241
|
+
*/
|
|
1242
|
+
refusedOnce(build, error) {
|
|
1243
|
+
if (refusedByDriver(error) && this.pipelines.drawsObjects(build.template))
|
|
1244
|
+
this.retries.push(build);
|
|
1245
|
+
else
|
|
1246
|
+
this.failed(error);
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* Builds the first pipeline that waits for its retry. A second refusal leaves its draws drawing
|
|
1250
|
+
* nothing, so the frames go on without those objects, and the backend reports it.
|
|
1251
|
+
*/
|
|
1252
|
+
retryRefused() {
|
|
1253
|
+
const build = this.retries.shift();
|
|
1254
|
+
this.running++;
|
|
1255
|
+
this.device.createRenderPipelineAsync(build.descriptor).then((pipeline) => {
|
|
1256
|
+
this.running--;
|
|
1257
|
+
this.built(this.renderPipelines, build.id, pipeline);
|
|
1258
|
+
}, (error) => {
|
|
1259
|
+
this.running--;
|
|
1260
|
+
this.builds--;
|
|
1261
|
+
// A pipeline destroyed meanwhile is no loss.
|
|
1262
|
+
if (this.renderPipelines[build.id] === null)
|
|
1263
|
+
this.refused?.(this.pipelines.describe(build.template, build.permutation), messageOf(error));
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
/** How to build the render pipeline of a `CreateRenderPipeline` command with its operands at `a`. */
|
|
1267
|
+
renderDescriptor(words, a) {
|
|
1268
|
+
return this.pipelines.render(words[a + 1], words[a + 2], this.format(words[a + 3]), this.format(words[a + 4]), words[a + 5], words[a + 6], words[a + 7], words[a + 8] | 0, floatOfBits(words[a + 9]));
|
|
1269
|
+
}
|
|
1270
|
+
built(table, id, pipeline) {
|
|
1271
|
+
// A pipeline destroyed while it built stays gone.
|
|
1272
|
+
if (table[id] === null)
|
|
1273
|
+
table[id] = pipeline;
|
|
1274
|
+
this.builds--;
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Forgets a render pipeline, which the browser frees once nothing holds it. One that waits for
|
|
1278
|
+
* its custom material's shader stops waiting. A pipeline that is gone already, as when a
|
|
1279
|
+
* capture replays a list again, changes nothing.
|
|
1280
|
+
*/
|
|
1281
|
+
destroyPipeline(id) {
|
|
1282
|
+
const parked = this.parked.findIndex((operands) => operands[0] === id);
|
|
1283
|
+
if (parked >= 0) {
|
|
1284
|
+
this.parked.splice(parked, 1);
|
|
1285
|
+
this.builds--;
|
|
1286
|
+
}
|
|
1287
|
+
const retry = this.retries.findIndex((build) => build.id === id);
|
|
1288
|
+
if (retry >= 0) {
|
|
1289
|
+
this.retries.splice(retry, 1);
|
|
1290
|
+
this.builds--;
|
|
1291
|
+
}
|
|
1292
|
+
this.renderPipelines[id] = undefined;
|
|
1293
|
+
if (DEV) {
|
|
1294
|
+
this.customOperands.delete(id);
|
|
1295
|
+
this.swaps.delete(id);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
failed(error) {
|
|
1299
|
+
this.builds--;
|
|
1300
|
+
this.buildFailure ??= error instanceof Error ? error.message : String(error);
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Replays the draw list in `words[start, end)`. `floats` views the same memory as `words`, for
|
|
1304
|
+
* float operands; the caller keeps both views and rebuilds them only when engine memory grows.
|
|
1305
|
+
* `memory` is the engine memory that WriteBuffer commands read from.
|
|
1306
|
+
*/
|
|
1307
|
+
replay(words, floats, start, end, memory) {
|
|
1308
|
+
const device = this.device;
|
|
1309
|
+
let pass;
|
|
1310
|
+
let computePass;
|
|
1311
|
+
if (this.buildFailure !== undefined)
|
|
1312
|
+
throw new Error(`a pipeline failed to build: ${this.buildFailure}`);
|
|
1313
|
+
for (let i = start; i < end;) {
|
|
1314
|
+
const header = words[i];
|
|
1315
|
+
const op = header & 0xff;
|
|
1316
|
+
let length = header >>> 8;
|
|
1317
|
+
if (length === 0 || i + length > end)
|
|
1318
|
+
throw new Error(`draw list is truncated at word ${i}`);
|
|
1319
|
+
const a = i + 1;
|
|
1320
|
+
this.replayOp = op;
|
|
1321
|
+
this.replayWord = i;
|
|
1322
|
+
switch (op) {
|
|
1323
|
+
case G.OP_CREATE_BUFFER: {
|
|
1324
|
+
// A capture draws the frame again, and the buffers of that frame exist already:
|
|
1325
|
+
// making one again would destroy the buffer that a read is still mapping it from,
|
|
1326
|
+
// and the read would fail with the buffer gone.
|
|
1327
|
+
if (this.canvasTarget && this.buffers[words[a]] !== undefined)
|
|
1328
|
+
break;
|
|
1329
|
+
this.counts.objects++;
|
|
1330
|
+
this.releaseBuffer(words[a]);
|
|
1331
|
+
// A buffer of indirect draws is also a source of copies: of each draw's arguments
|
|
1332
|
+
// where a render pass with several of its draws copies them out
|
|
1333
|
+
// (./indirect-arguments.ts), and of the counts that the culling shaders wrote
|
|
1334
|
+
// while the page samples (./culled-counts.ts).
|
|
1335
|
+
const usage = words[a + 2];
|
|
1336
|
+
const gpuUsage = usage & ~G.BUFFER_USAGE_DROP_COUNTED;
|
|
1337
|
+
this.buffers[words[a]] = device.createBuffer({
|
|
1338
|
+
label: usage & G.BUFFER_USAGE_DROP_COUNTED ? DROP_COUNTED_LABEL : undefined,
|
|
1339
|
+
size: words[a + 1],
|
|
1340
|
+
usage: gpuUsage & G.BUFFER_USAGE_INDIRECT ? gpuUsage | G.BUFFER_USAGE_COPY_SRC : gpuUsage,
|
|
1341
|
+
});
|
|
1342
|
+
this.gpuMemory.addBuffers(words[a + 1]);
|
|
1343
|
+
break;
|
|
1344
|
+
}
|
|
1345
|
+
case G.OP_WRITE_BUFFER: {
|
|
1346
|
+
const target = this.need(this.buffers, words[a], 'buffer');
|
|
1347
|
+
const offset = words[a + 1];
|
|
1348
|
+
const source = words[a + 2];
|
|
1349
|
+
const size = words[a + 3];
|
|
1350
|
+
// A staged upload is a copy in the frame's commands, recorded before the next
|
|
1351
|
+
// command, while writeBuffer lands before them all. A frame's writes never overlap
|
|
1352
|
+
// and come before its passes, so either route leaves the same data. Mid-size
|
|
1353
|
+
// uploads take the route that the timings of this device favor.
|
|
1354
|
+
const covered = UploadRoutes.covers(size);
|
|
1355
|
+
const timed = covered && this.routes.timing;
|
|
1356
|
+
let staged = false;
|
|
1357
|
+
let start = timed ? performance.now() : 0;
|
|
1358
|
+
if (covered && !pass && !computePass && this.routes.takesRing(size)) {
|
|
1359
|
+
staged = this.staging.write(target, offset, memory, source, size);
|
|
1360
|
+
if (staged && timed)
|
|
1361
|
+
this.routes.wroteToRing(size, performance.now() - start);
|
|
1362
|
+
else if (timed)
|
|
1363
|
+
start = performance.now();
|
|
1364
|
+
}
|
|
1365
|
+
if (staged)
|
|
1366
|
+
this.counts.stagedBytes += size;
|
|
1367
|
+
else {
|
|
1368
|
+
device.queue.writeBuffer(target, offset, memory, source, size);
|
|
1369
|
+
if (timed)
|
|
1370
|
+
this.routes.wroteDirect(size, performance.now() - start);
|
|
1371
|
+
}
|
|
1372
|
+
this.counts.uploadBytes += size;
|
|
1373
|
+
break;
|
|
1374
|
+
}
|
|
1375
|
+
case G.OP_DESTROY_BUFFER:
|
|
1376
|
+
this.releaseBuffer(words[a]);
|
|
1377
|
+
break;
|
|
1378
|
+
case G.OP_CREATE_TEXTURE:
|
|
1379
|
+
this.counts.objects++;
|
|
1380
|
+
this.createTexture(words, a);
|
|
1381
|
+
break;
|
|
1382
|
+
case G.OP_CREATE_TEXTURE_VIEW:
|
|
1383
|
+
this.counts.objects++;
|
|
1384
|
+
this.createView(words, a);
|
|
1385
|
+
break;
|
|
1386
|
+
case G.OP_CREATE_BIND_VIEW:
|
|
1387
|
+
this.counts.objects++;
|
|
1388
|
+
this.createBindView(words, a);
|
|
1389
|
+
break;
|
|
1390
|
+
case G.OP_CLEAR_TEXTURE:
|
|
1391
|
+
this.clearTexture(words, a);
|
|
1392
|
+
break;
|
|
1393
|
+
case G.OP_WRITE_TEXTURE: {
|
|
1394
|
+
// A texel write lands when the queue receives it, as writeBuffer does, before the
|
|
1395
|
+
// commands recorded since the last submit. WebGPU counts a compressed write in
|
|
1396
|
+
// whole blocks, which may reach past a small mip level's edge.
|
|
1397
|
+
const copy = this.copy;
|
|
1398
|
+
const id = words[a];
|
|
1399
|
+
const block = G.FORMAT_BLOCK_SIZE[this.formats[id]] ?? 1;
|
|
1400
|
+
const blocksWide = Math.ceil(words[a + 5] / block);
|
|
1401
|
+
const blocksHigh = Math.ceil(words[a + 6] / block);
|
|
1402
|
+
copy.setDestination(this.need(this.textures, id, 'texture'), words, a);
|
|
1403
|
+
copy.setSize(blocksWide * block, blocksHigh * block, words[a + 7]);
|
|
1404
|
+
copy.setLayout(words[a + 8], blocksWide * this.blockBytes(id), blocksHigh);
|
|
1405
|
+
device.queue.writeTexture(copy.destination, memory, copy.layout, copy.size);
|
|
1406
|
+
this.counts.uploadBytes += words[a + 9];
|
|
1407
|
+
break;
|
|
1408
|
+
}
|
|
1409
|
+
case G.OP_UPLOAD_IMAGE: {
|
|
1410
|
+
const copy = this.copy;
|
|
1411
|
+
const id = words[a];
|
|
1412
|
+
const imageId = words[a + 7];
|
|
1413
|
+
const flags = words[a + 8];
|
|
1414
|
+
const image = this.images.need(imageId);
|
|
1415
|
+
const width = words[a + 5];
|
|
1416
|
+
const height = words[a + 6];
|
|
1417
|
+
copy.setDestination(this.need(this.textures, id, 'texture'), words, a);
|
|
1418
|
+
copy.destination.premultipliedAlpha = (flags & G.UPLOAD_PREMULTIPLIED_ALPHA) !== 0;
|
|
1419
|
+
copy.setImage(image, words[a + 9], words[a + 10]);
|
|
1420
|
+
copy.setSize(width, height, 1);
|
|
1421
|
+
device.queue.copyExternalImageToTexture(copy.image, copy.destination, copy.size);
|
|
1422
|
+
this.counts.uploadBytes += width * height * this.blockBytes(id);
|
|
1423
|
+
if (flags & G.UPLOAD_RELEASE)
|
|
1424
|
+
this.images.release(imageId);
|
|
1425
|
+
break;
|
|
1426
|
+
}
|
|
1427
|
+
case G.OP_RELEASE_IMAGE:
|
|
1428
|
+
this.images.release(words[a]);
|
|
1429
|
+
break;
|
|
1430
|
+
case G.OP_DESTROY_PIPELINE:
|
|
1431
|
+
this.destroyPipeline(words[a]);
|
|
1432
|
+
break;
|
|
1433
|
+
case G.OP_GENERATE_TEXTURE:
|
|
1434
|
+
case G.OP_SKY_MAP_STEP:
|
|
1435
|
+
this.generateTexture(op, words, floats, a);
|
|
1436
|
+
break;
|
|
1437
|
+
case G.OP_PROBE_FILTER:
|
|
1438
|
+
this.filterProbe(words, a);
|
|
1439
|
+
break;
|
|
1440
|
+
case G.OP_GENERATE_MIPMAPS:
|
|
1441
|
+
this.generateMipmaps(words[a], words[a + 1]);
|
|
1442
|
+
break;
|
|
1443
|
+
case G.OP_COPY_INTO_IMAGE:
|
|
1444
|
+
this.copyIntoImage(words, a);
|
|
1445
|
+
break;
|
|
1446
|
+
case G.OP_COPY_TEXTURE_TO_TEXTURE:
|
|
1447
|
+
this.copyTexture(words, a);
|
|
1448
|
+
break;
|
|
1449
|
+
// A capture replays a frame that the loop replayed already, whose reads would land twice.
|
|
1450
|
+
case G.OP_COPY_TEXTURE_TO_BUFFER: {
|
|
1451
|
+
if (this.canvasTarget)
|
|
1452
|
+
break;
|
|
1453
|
+
const copy = this.copy;
|
|
1454
|
+
const source = this.need(this.textures, words[a], 'texture');
|
|
1455
|
+
const buffer = this.need(this.buffers, words[a + 5], 'buffer');
|
|
1456
|
+
copy.setSource(source, words, a);
|
|
1457
|
+
this.commandEncoder().copyTextureToBuffer(copy.source, {
|
|
1458
|
+
buffer,
|
|
1459
|
+
offset: words[a + 6],
|
|
1460
|
+
bytesPerRow: words[a + 7],
|
|
1461
|
+
rowsPerImage: words[a + 8],
|
|
1462
|
+
}, {
|
|
1463
|
+
width: words[a + 9],
|
|
1464
|
+
height: words[a + 10],
|
|
1465
|
+
depthOrArrayLayers: 1,
|
|
1466
|
+
});
|
|
1467
|
+
break;
|
|
1468
|
+
}
|
|
1469
|
+
case G.OP_CREATE_SAMPLER:
|
|
1470
|
+
this.counts.objects++;
|
|
1471
|
+
this.createSampler(words, floats, a);
|
|
1472
|
+
break;
|
|
1473
|
+
case G.OP_RESIZE_CANVAS: {
|
|
1474
|
+
const canvas = this.context?.canvas;
|
|
1475
|
+
const width = words[a];
|
|
1476
|
+
const height = words[a + 1];
|
|
1477
|
+
if (canvas && (canvas.width !== width || canvas.height !== height)) {
|
|
1478
|
+
canvas.width = width;
|
|
1479
|
+
canvas.height = height;
|
|
1480
|
+
}
|
|
1481
|
+
break;
|
|
1482
|
+
}
|
|
1483
|
+
case G.OP_DESTROY_TEXTURE:
|
|
1484
|
+
this.releaseTexture(words[a]);
|
|
1485
|
+
break;
|
|
1486
|
+
case G.OP_CREATE_RENDER_PIPELINE:
|
|
1487
|
+
case G.OP_CREATE_COMPUTE_PIPELINE:
|
|
1488
|
+
// A list that creates a pipeline after other commands builds it at once.
|
|
1489
|
+
this.listing.add(op, words, a);
|
|
1490
|
+
this.createPipeline(op, words, a, false);
|
|
1491
|
+
break;
|
|
1492
|
+
case G.OP_CREATE_BIND_GROUP:
|
|
1493
|
+
this.counts.objects++;
|
|
1494
|
+
this.createBindGroup(words, a);
|
|
1495
|
+
break;
|
|
1496
|
+
case G.OP_CLEAR_BUFFER:
|
|
1497
|
+
this.commandEncoder().clearBuffer(this.need(this.buffers, words[a], 'buffer'), words[a + 1], words[a + 2]);
|
|
1498
|
+
break;
|
|
1499
|
+
case G.OP_BEGIN_RENDER_PASS: {
|
|
1500
|
+
const flags = words[a + 8];
|
|
1501
|
+
const setup = this.renderPass;
|
|
1502
|
+
setup.setColor(this.colorView(words[a], words[a + 1]), this.targetView(words[a + 1]), (flags & G.PASS_CLEAR_COLOR) !== 0, (flags & G.PASS_STORE_COLOR) !== 0, floats, a + 3);
|
|
1503
|
+
// The weighted layer's pass names a second color target after the flags, then
|
|
1504
|
+
// its label and its scope. A pass without a second target leaves its word out,
|
|
1505
|
+
// so the command is shorter.
|
|
1506
|
+
const second = length > 12 ? words[a + 9] : G.NO_TARGET;
|
|
1507
|
+
setup.setSecondColor(second === G.NO_TARGET ? undefined : this.targetView(second));
|
|
1508
|
+
setup.setDepth(this.targetView(words[a + 2]), (flags & G.PASS_CLEAR_DEPTH) !== 0, (flags & G.PASS_STORE_DEPTH) !== 0, floats, a + 7);
|
|
1509
|
+
setup.setTimestampWrites(this.timer?.passWrites(true, passLabel(a, length, words), passScope(a, length, words)));
|
|
1510
|
+
this.indirect.begin(words, i + length, end, this.bundles, this.buffers, this.openEncoder);
|
|
1511
|
+
pass = this.commandEncoder().beginRenderPass(setup.descriptor);
|
|
1512
|
+
this.skipDraws = false;
|
|
1513
|
+
break;
|
|
1514
|
+
}
|
|
1515
|
+
case G.OP_SET_VIEWPORT:
|
|
1516
|
+
pass?.setViewport(words[a], words[a + 1], words[a + 2], words[a + 3], floats[a + 4], floats[a + 5]);
|
|
1517
|
+
break;
|
|
1518
|
+
case G.OP_SET_SCISSOR:
|
|
1519
|
+
pass?.setScissorRect(words[a], words[a + 1], words[a + 2], words[a + 3]);
|
|
1520
|
+
break;
|
|
1521
|
+
case G.OP_SET_BIND_GROUP:
|
|
1522
|
+
if (computePass)
|
|
1523
|
+
this.setBindGroup(computePass, words, a);
|
|
1524
|
+
else if (pass)
|
|
1525
|
+
this.setBindGroup(pass, words, a);
|
|
1526
|
+
break;
|
|
1527
|
+
case G.OP_SET_PIPELINE:
|
|
1528
|
+
case G.OP_SET_VERTEX_BUFFER:
|
|
1529
|
+
case G.OP_SET_INDEX_BUFFER:
|
|
1530
|
+
case G.OP_DRAW:
|
|
1531
|
+
case G.OP_DRAW_INDEXED:
|
|
1532
|
+
case G.OP_DRAW_INDEXED_INDIRECT:
|
|
1533
|
+
if (pass)
|
|
1534
|
+
this.passCommand(op, words, a, pass);
|
|
1535
|
+
break;
|
|
1536
|
+
case G.OP_EXECUTE_BUNDLES:
|
|
1537
|
+
for (let k = 0; pass && k < words[a]; k++)
|
|
1538
|
+
this.replayBundle(this.need(this.bundles, words[a + 1 + k], 'bundle'), pass);
|
|
1539
|
+
break;
|
|
1540
|
+
case G.OP_END_RENDER_PASS:
|
|
1541
|
+
pass?.end();
|
|
1542
|
+
pass = undefined;
|
|
1543
|
+
break;
|
|
1544
|
+
case G.OP_BEGIN_BUNDLE: {
|
|
1545
|
+
// The commands up to the bundle's end are kept to replay, and not carried out now.
|
|
1546
|
+
const first = i + length;
|
|
1547
|
+
let last = first;
|
|
1548
|
+
while (last < end && (words[last] & 0xff) !== G.OP_END_BUNDLE) {
|
|
1549
|
+
const size = words[last] >>> 8;
|
|
1550
|
+
if (size === 0)
|
|
1551
|
+
break;
|
|
1552
|
+
last += size;
|
|
1553
|
+
}
|
|
1554
|
+
if (last >= end)
|
|
1555
|
+
throw new Error(`the bundle at word ${i} has no end`);
|
|
1556
|
+
this.bundles[words[a]] = words.slice(first, last);
|
|
1557
|
+
length = last - i + (words[last] >>> 8);
|
|
1558
|
+
break;
|
|
1559
|
+
}
|
|
1560
|
+
case G.OP_BEGIN_COMPUTE_PASS:
|
|
1561
|
+
// The pass names its label, then its scope.
|
|
1562
|
+
this.computePass.timestampWrites = this.timer?.passWrites(false, length > 0 ? words[a] : 0, length > 1 ? words[a + 1] : 0);
|
|
1563
|
+
computePass = this.commandEncoder().beginComputePass(this.computePass);
|
|
1564
|
+
this.skipDispatches = false;
|
|
1565
|
+
break;
|
|
1566
|
+
case G.OP_SET_COMPUTE_PIPELINE: {
|
|
1567
|
+
const pipeline = this.need(this.computePipelines, words[a], 'compute pipeline');
|
|
1568
|
+
this.skipDispatches = pipeline === null;
|
|
1569
|
+
if (pipeline)
|
|
1570
|
+
computePass?.setPipeline(pipeline);
|
|
1571
|
+
break;
|
|
1572
|
+
}
|
|
1573
|
+
case G.OP_DISPATCH:
|
|
1574
|
+
if (this.skipDispatches)
|
|
1575
|
+
break;
|
|
1576
|
+
this.counts.dispatches++;
|
|
1577
|
+
computePass?.dispatchWorkgroups(words[a], words[a + 1], words[a + 2]);
|
|
1578
|
+
break;
|
|
1579
|
+
case G.OP_END_COMPUTE_PASS:
|
|
1580
|
+
computePass?.end();
|
|
1581
|
+
computePass = undefined;
|
|
1582
|
+
break;
|
|
1583
|
+
case G.OP_COPY_BUFFER_TO_BUFFER: {
|
|
1584
|
+
const target = this.need(this.buffers, words[a + 2], 'buffer');
|
|
1585
|
+
// A capture replays a frame that the loop replayed already, and skips its reads. A
|
|
1586
|
+
// copy into a buffer that a read maps would reach it while the first replay's map
|
|
1587
|
+
// may still be under way, which the device refuses.
|
|
1588
|
+
if (this.canvasTarget && (target.usage & GPUBufferUsage.MAP_READ) !== 0)
|
|
1589
|
+
break;
|
|
1590
|
+
this.commandEncoder().copyBufferToBuffer(this.need(this.buffers, words[a], 'buffer'), words[a + 1], target, words[a + 3], words[a + 4]);
|
|
1591
|
+
break;
|
|
1592
|
+
}
|
|
1593
|
+
case G.OP_READ_BUFFER:
|
|
1594
|
+
if (this.canvasTarget)
|
|
1595
|
+
break;
|
|
1596
|
+
this.reads.add(this.need(this.buffers, words[a], 'buffer'), words[a + 1], words[a + 2], words[a + 3], words[a + 4]);
|
|
1597
|
+
break;
|
|
1598
|
+
case G.OP_SUBMIT:
|
|
1599
|
+
this.submit();
|
|
1600
|
+
break;
|
|
1601
|
+
default:
|
|
1602
|
+
throw new Error(`unknown draw list command ${op} at word ${i}`);
|
|
1603
|
+
}
|
|
1604
|
+
i += length;
|
|
1605
|
+
}
|
|
1606
|
+
this.submit();
|
|
1607
|
+
// A list that destroyed a texture and recorded no command still lets the device free it.
|
|
1608
|
+
if (this.retiredTextures.length > 0)
|
|
1609
|
+
this.destroyRetiredTextures();
|
|
1610
|
+
this.reads.start(this.readSink);
|
|
1611
|
+
this.staging.endFrame();
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Makes a bind group and keeps what it names. A data texture is made again on the same id when
|
|
1615
|
+
* the scene grows, so a group that names it is made again, from these words, before its next
|
|
1616
|
+
* set. The words are copied, because the draw list's memory is used again, into a buffer that
|
|
1617
|
+
* the group keeps, so a group that a frame makes again allocates nothing.
|
|
1618
|
+
*/
|
|
1619
|
+
createBindGroup(words, a) {
|
|
1620
|
+
const id = words[a];
|
|
1621
|
+
const length = 3 + 5 * words[a + 2];
|
|
1622
|
+
let kept = this.bindGroupWords[id];
|
|
1623
|
+
if (kept === undefined || kept.length !== length) {
|
|
1624
|
+
kept = new Uint32Array(length);
|
|
1625
|
+
this.bindGroupWords[id] = kept;
|
|
1626
|
+
}
|
|
1627
|
+
// A loop, not subarray: a view of the draw list would be one allocation for every group that
|
|
1628
|
+
// a frame makes again.
|
|
1629
|
+
for (let k = 0; k < length; k++)
|
|
1630
|
+
kept[k] = words[a + k];
|
|
1631
|
+
this.bindGroups[id] = this.makeBindGroup(kept, 0);
|
|
1632
|
+
this.bindGroupEpoch[id] = this.textureEpoch;
|
|
1633
|
+
}
|
|
1634
|
+
/** Makes a bind group's native object from the words that name its resources, at `a`. */
|
|
1635
|
+
makeBindGroup(words, a) {
|
|
1636
|
+
const layout = this.pipelines.layout(words[a + 1]);
|
|
1637
|
+
const entries = [];
|
|
1638
|
+
for (let e = 0, at = a + 3; e < words[a + 2]; e++, at += 5) {
|
|
1639
|
+
const kind = words[at + 1];
|
|
1640
|
+
const id = words[at + 2];
|
|
1641
|
+
const size = words[at + 4];
|
|
1642
|
+
let resource;
|
|
1643
|
+
if (kind === G.RESOURCE_BUFFER)
|
|
1644
|
+
resource = {
|
|
1645
|
+
buffer: this.need(this.buffers, id, 'buffer'),
|
|
1646
|
+
offset: words[at + 3],
|
|
1647
|
+
size: size === 0 ? undefined : size,
|
|
1648
|
+
};
|
|
1649
|
+
else if (kind === G.RESOURCE_TEXTURE)
|
|
1650
|
+
resource = this.need(this.bindingViews, id, 'bound texture');
|
|
1651
|
+
else if (kind === G.RESOURCE_SAMPLER)
|
|
1652
|
+
resource = this.need(this.samplers, id, 'sampler');
|
|
1653
|
+
else
|
|
1654
|
+
throw new Error(`unknown bind group resource kind ${kind}`);
|
|
1655
|
+
entries.push({ binding: words[at], resource });
|
|
1656
|
+
}
|
|
1657
|
+
return this.device.createBindGroup({ layout, entries });
|
|
1658
|
+
}
|
|
1659
|
+
/** Sets a bind group on a pass. The dynamic offsets are read straight from the draw list. */
|
|
1660
|
+
setBindGroup(pass, words, a) {
|
|
1661
|
+
const id = words[a + 1];
|
|
1662
|
+
// A texture that a group names was made again on its id, so the group takes its new view.
|
|
1663
|
+
if (this.bindGroupEpoch[id] !== this.textureEpoch) {
|
|
1664
|
+
const kept = this.bindGroupWords[id];
|
|
1665
|
+
if (kept !== undefined) {
|
|
1666
|
+
this.bindGroups[id] = this.makeBindGroup(kept, 0);
|
|
1667
|
+
this.bindGroupEpoch[id] = this.textureEpoch;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
pass.setBindGroup(words[a], this.need(this.bindGroups, id, 'bind group'), words, a + 3, words[a + 2]);
|
|
1671
|
+
}
|
|
1672
|
+
/**
|
|
1673
|
+
* Carries out a command that sets render pass state or draws, with its operands at `a`, and
|
|
1674
|
+
* returns false for any other command. Draw lists and recorded bundles share it.
|
|
1675
|
+
*/
|
|
1676
|
+
passCommand(op, words, a, pass) {
|
|
1677
|
+
switch (op) {
|
|
1678
|
+
case G.OP_SET_PIPELINE: {
|
|
1679
|
+
const id = words[a];
|
|
1680
|
+
const pipeline = this.need(this.renderPipelines, id, 'render pipeline');
|
|
1681
|
+
this.skipDraws = pipeline === null;
|
|
1682
|
+
this.lines = this.lineLists[id] === true;
|
|
1683
|
+
if (pipeline)
|
|
1684
|
+
pass.setPipeline(pipeline);
|
|
1685
|
+
return true;
|
|
1686
|
+
}
|
|
1687
|
+
case G.OP_SET_BIND_GROUP:
|
|
1688
|
+
this.setBindGroup(pass, words, a);
|
|
1689
|
+
return true;
|
|
1690
|
+
// A size of 0 binds the rest of the buffer. The browser compiles each call for the kinds of
|
|
1691
|
+
// argument it has seen, and throws the compiled code away when a number turns undefined,
|
|
1692
|
+
// so the size goes to a call of its own.
|
|
1693
|
+
case G.OP_SET_VERTEX_BUFFER: {
|
|
1694
|
+
const slot = words[a];
|
|
1695
|
+
const buffer = this.need(this.buffers, words[a + 1], 'buffer');
|
|
1696
|
+
const offset = words[a + 2];
|
|
1697
|
+
const size = words[a + 3];
|
|
1698
|
+
if (size === 0)
|
|
1699
|
+
pass.setVertexBuffer(slot, buffer, offset);
|
|
1700
|
+
else
|
|
1701
|
+
pass.setVertexBuffer(slot, buffer, offset, size);
|
|
1702
|
+
return true;
|
|
1703
|
+
}
|
|
1704
|
+
case G.OP_SET_INDEX_BUFFER: {
|
|
1705
|
+
const buffer = this.need(this.buffers, words[a], 'buffer');
|
|
1706
|
+
const format = words[a + 1] === G.INDEX_FORMAT_UINT32 ? 'uint32' : 'uint16';
|
|
1707
|
+
const offset = words[a + 2];
|
|
1708
|
+
const size = words[a + 3];
|
|
1709
|
+
if (size === 0)
|
|
1710
|
+
pass.setIndexBuffer(buffer, format, offset);
|
|
1711
|
+
else
|
|
1712
|
+
pass.setIndexBuffer(buffer, format, offset, size);
|
|
1713
|
+
return true;
|
|
1714
|
+
}
|
|
1715
|
+
case G.OP_DRAW:
|
|
1716
|
+
if (this.skipDraws)
|
|
1717
|
+
return this.skipDraw();
|
|
1718
|
+
this.countDraw(words[a], words[a + 1]);
|
|
1719
|
+
pass.draw(words[a], words[a + 1], words[a + 2], words[a + 3]);
|
|
1720
|
+
return true;
|
|
1721
|
+
case G.OP_DRAW_INDEXED:
|
|
1722
|
+
if (this.skipDraws)
|
|
1723
|
+
return this.skipDraw();
|
|
1724
|
+
this.countDraw(words[a], words[a + 1]);
|
|
1725
|
+
pass.drawIndexed(words[a], words[a + 1], words[a + 2], words[a + 3] | 0, words[a + 4]);
|
|
1726
|
+
return true;
|
|
1727
|
+
case G.OP_DRAW_INDEXED_INDIRECT: {
|
|
1728
|
+
const id = words[a];
|
|
1729
|
+
const offset = words[a + 1];
|
|
1730
|
+
const copy = this.indirect.take(id, offset);
|
|
1731
|
+
if (this.skipDraws)
|
|
1732
|
+
return this.skipDraw();
|
|
1733
|
+
this.counts.drawCalls++;
|
|
1734
|
+
const buffer = this.need(this.buffers, id, 'buffer');
|
|
1735
|
+
if (this.culled)
|
|
1736
|
+
this.culled.note(buffer, offset, this.lines);
|
|
1737
|
+
else
|
|
1738
|
+
this.culledDrawn = true;
|
|
1739
|
+
if (copy)
|
|
1740
|
+
pass.drawIndexedIndirect(copy, 0);
|
|
1741
|
+
else
|
|
1742
|
+
pass.drawIndexedIndirect(buffer, offset);
|
|
1743
|
+
return true;
|
|
1744
|
+
}
|
|
1745
|
+
default:
|
|
1746
|
+
return false;
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
/** Counts a draw that its pipeline's build keeps from drawing, and reports the command as handled. */
|
|
1750
|
+
skipDraw() {
|
|
1751
|
+
this.counts.skippedDraws++;
|
|
1752
|
+
return true;
|
|
1753
|
+
}
|
|
1754
|
+
/** Replays a recorded bundle's commands into the render pass. */
|
|
1755
|
+
replayBundle(commands, pass) {
|
|
1756
|
+
for (let i = 0; i < commands.length;) {
|
|
1757
|
+
const header = commands[i];
|
|
1758
|
+
if (!this.passCommand(header & 0xff, commands, i + 1, pass))
|
|
1759
|
+
throw new Error(`a bundle holds command ${header & 0xff}, which only a pass can run`);
|
|
1760
|
+
i += header >>> 8;
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
/** A buffer by id, for readback in tests. */
|
|
1764
|
+
buffer(id) {
|
|
1765
|
+
return this.buffers[id];
|
|
1766
|
+
}
|
|
1767
|
+
/** Destroys a buffer that the backend made, and takes its bytes off the memory total. */
|
|
1768
|
+
destroyBuffer(buffer) {
|
|
1769
|
+
buffer.destroy();
|
|
1770
|
+
this.gpuMemory.addBuffers(-buffer.size);
|
|
1771
|
+
}
|
|
1772
|
+
/** Destroys the draw list's buffer of an id, where there is one. */
|
|
1773
|
+
releaseBuffer(id) {
|
|
1774
|
+
const buffer = this.buffers[id];
|
|
1775
|
+
if (!buffer)
|
|
1776
|
+
return;
|
|
1777
|
+
this.reads.drop(buffer);
|
|
1778
|
+
this.destroyBuffer(buffer);
|
|
1779
|
+
this.buffers[id] = undefined;
|
|
1780
|
+
}
|
|
1781
|
+
destroy() {
|
|
1782
|
+
this.early?.stop();
|
|
1783
|
+
this.early = undefined;
|
|
1784
|
+
for (let id = 0; id < this.buffers.length; id++)
|
|
1785
|
+
this.releaseBuffer(id);
|
|
1786
|
+
for (let id = 0; id < this.textures.length; id++)
|
|
1787
|
+
this.releaseTexture(id);
|
|
1788
|
+
this.bindGroupWords.length = 0;
|
|
1789
|
+
this.bindGroupEpoch.length = 0;
|
|
1790
|
+
this.textureEpoch = 0;
|
|
1791
|
+
this.endCapture();
|
|
1792
|
+
if (this.ownsImages)
|
|
1793
|
+
this.images.clear();
|
|
1794
|
+
this.staging.destroy();
|
|
1795
|
+
this.indirect.destroy();
|
|
1796
|
+
if (this.copyBuffer)
|
|
1797
|
+
this.destroyBuffer(this.copyBuffer);
|
|
1798
|
+
this.copyBuffer = undefined;
|
|
1799
|
+
this.destroyRetired();
|
|
1800
|
+
// The device goes with the backend, so its queue reports nothing more to wait for.
|
|
1801
|
+
for (const entry of this.retiredTextures) {
|
|
1802
|
+
entry.texture.destroy();
|
|
1803
|
+
this.gpuMemory.addTextures(-entry.bytes);
|
|
1804
|
+
}
|
|
1805
|
+
for (const entry of this.retiringTextures) {
|
|
1806
|
+
entry.texture.destroy();
|
|
1807
|
+
this.gpuMemory.addTextures(-entry.bytes);
|
|
1808
|
+
}
|
|
1809
|
+
this.retiredTextures.length = 0;
|
|
1810
|
+
this.retiringTextures.length = 0;
|
|
1811
|
+
}
|
|
1812
|
+
}
|