@woosh/meep-engine 3.43.0 → 3.45.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/build/bundle-worker-terrain.js +1 -1
- package/editor/prototypeEditorShell.d.ts.map +1 -1
- package/editor/prototypeEditorShell.js +4 -2
- package/package.json +1 -1
- package/src/core/collection/array/array_sort_insertion_ascending.d.ts +19 -0
- package/src/core/collection/array/array_sort_insertion_ascending.d.ts.map +1 -0
- package/src/core/collection/array/array_sort_insertion_ascending.js +31 -0
- package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts +27 -0
- package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_array_round_outward_f32.js +39 -0
- package/src/core/geom/3d/aabb/aabb3_from_v3_array.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_from_v3_array.js +4 -1
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts +2 -2
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.js +1 -1
- package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts +21 -0
- package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.d.ts.map +1 -0
- package/src/core/geom/3d/pose/pose3_apply_inverse_point_array.js +36 -0
- package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts +25 -0
- package/src/core/geom/3d/pose/pose3_apply_point_array.d.ts.map +1 -0
- package/src/core/geom/3d/pose/pose3_apply_point_array.js +40 -0
- package/src/core/geom/3d/pose/pose3_compose_array.d.ts +28 -0
- package/src/core/geom/3d/pose/pose3_compose_array.d.ts.map +1 -0
- package/src/core/geom/3d/pose/pose3_compose_array.js +41 -0
- package/src/core/geom/3d/pose/pose3_to_local_array.d.ts +29 -0
- package/src/core/geom/3d/pose/pose3_to_local_array.d.ts.map +1 -0
- package/src/core/geom/3d/pose/pose3_to_local_array.js +42 -0
- package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts +28 -0
- package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_clamp_angle_array.js +66 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts +22 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_left_array.js +30 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts +23 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_multiply_conjugate_right_array.js +31 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts +26 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal_area_weighted_array.js +46 -0
- package/src/core/geom/vec3/v3_distance_array.d.ts +11 -0
- package/src/core/geom/vec3/v3_distance_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_distance_array.js +19 -0
- package/src/core/geom/vec3/v3_normalize_array_checked.d.ts +23 -0
- package/src/core/geom/vec3/v3_normalize_array_checked.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_normalize_array_checked.js +49 -0
- package/src/core/geom/vec3/v3_reject_array.d.ts +15 -0
- package/src/core/geom/vec3/v3_reject_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_reject_array.js +32 -0
- package/src/core/graph/csr/csr_build_incidence.d.ts +26 -0
- package/src/core/graph/csr/csr_build_incidence.d.ts.map +1 -0
- package/src/core/graph/csr/csr_build_incidence.js +71 -0
- package/src/core/graph/csr/csr_graph_color_greedy.d.ts +25 -0
- package/src/core/graph/csr/csr_graph_color_greedy.d.ts.map +1 -0
- package/src/core/graph/csr/csr_graph_color_greedy.js +83 -0
- package/src/core/graph/csr/csr_graph_validate_coloring.d.ts +15 -0
- package/src/core/graph/csr/csr_graph_validate_coloring.d.ts.map +1 -0
- package/src/core/graph/csr/csr_graph_validate_coloring.js +33 -0
- package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts +26 -0
- package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.d.ts.map +1 -0
- package/src/core/math/linalg/matrix_symmetric_3x3_solve_ldlt.js +71 -0
- package/src/core/math/max2_exact.d.ts +15 -0
- package/src/core/math/max2_exact.d.ts.map +1 -0
- package/src/core/math/max2_exact.js +30 -0
- package/src/core/math/min2_exact.d.ts +20 -0
- package/src/core/math/min2_exact.d.ts.map +1 -0
- package/src/core/math/min2_exact.js +35 -0
- package/src/engine/Clock.d.ts +15 -0
- package/src/engine/Clock.d.ts.map +1 -1
- package/src/engine/Clock.js +29 -5
- package/src/engine/Engine.d.ts.map +1 -1
- package/src/engine/Engine.js +11 -19
- package/src/engine/ecs/ik/IKGoalSystem.d.ts.map +1 -1
- package/src/engine/ecs/ik/IKGoalSystem.js +3 -19
- package/src/engine/ecs/parent/parent_entity_model_of.d.ts +17 -0
- package/src/engine/ecs/parent/parent_entity_model_of.d.ts.map +1 -0
- package/src/engine/ecs/parent/parent_entity_model_of.js +26 -0
- package/src/engine/ecs/transform/t64_read_pose_array.d.ts +15 -0
- package/src/engine/ecs/transform/t64_read_pose_array.d.ts.map +1 -0
- package/src/engine/ecs/transform/t64_read_pose_array.js +24 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts +57 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts.map +1 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.js +84 -0
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts +2 -0
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.d.ts.map +1 -1
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal_area_weighted.js +10 -21
- package/src/engine/graphics3/AnimationGraphSystem.d.ts +28 -13
- package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationGraphSystem.js +107 -64
- package/src/engine/graphics3/AnimationSystem.d.ts +29 -15
- package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationSystem.js +112 -61
- package/src/engine/graphics3/MeshSkinSystem.d.ts +56 -0
- package/src/engine/graphics3/MeshSkinSystem.d.ts.map +1 -0
- package/src/engine/graphics3/MeshSkinSystem.js +317 -0
- package/src/engine/graphics3/MeshSystem.d.ts +15 -35
- package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
- package/src/engine/graphics3/MeshSystem.js +21 -298
- package/src/engine/graphics3/RowChains.d.ts +76 -0
- package/src/engine/graphics3/RowChains.d.ts.map +1 -0
- package/src/engine/graphics3/RowChains.js +347 -0
- package/src/engine/graphics3/ShadedGeometrySystem.d.ts +6 -0
- package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -1
- package/src/engine/graphics3/ShadedGeometrySystem.js +329 -309
- package/src/engine/graphics3/animation/AnimationClips.d.ts +56 -0
- package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -0
- package/src/engine/graphics3/animation/AnimationClips.js +79 -0
- package/src/engine/graphics3/animation/ClipListPlayer.d.ts +13 -14
- package/src/engine/graphics3/animation/ClipListPlayer.d.ts.map +1 -1
- package/src/engine/graphics3/animation/ClipListPlayer.js +262 -263
- package/src/engine/graphics3/animation/write_clip_playback.d.ts +3 -3
- package/src/engine/graphics3/animation/write_clip_playback.js +4 -4
- package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts +5 -0
- package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
- package/src/engine/graphics3/pose/query_entity_node_world_pose.js +80 -75
- package/src/engine/graphics3/prefab/PrefabInstance.d.ts +4 -24
- package/src/engine/graphics3/prefab/PrefabInstance.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/PrefabInstance.js +60 -80
- package/src/engine/graphics3/prefab/prefab_instantiate.d.ts +16 -3
- package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_instantiate.js +49 -12
- package/src/engine/graphics3/prefab/prefab_place.d.ts +31 -17
- package/src/engine/graphics3/prefab/prefab_place.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_place.js +175 -130
- package/src/engine/graphics3/register_clips.d.ts +93 -0
- package/src/engine/graphics3/register_clips.d.ts.map +1 -0
- package/src/engine/graphics3/register_clips.js +166 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +9 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -1
- package/src/engine/physics/broadphase/compute_fat_world_aabb.js +3 -1
- package/src/engine/physics/cloth/MEASUREMENTS.md +795 -0
- package/src/engine/physics/cloth/PLAN.md +349 -17
- package/src/engine/physics/cloth/build/ClothProxy.d.ts +113 -61
- package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -1
- package/src/engine/physics/cloth/build/ClothProxy.js +142 -77
- package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts +44 -0
- package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts.map +1 -0
- package/src/engine/physics/cloth/build/cloth_bind_in_frame.js +107 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +43 -30
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -1
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +371 -284
- package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts +62 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts.map +1 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.js +275 -0
- package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts +7 -0
- package/src/engine/physics/cloth/collider/ClothColliderIndex.d.ts.map +1 -1
- package/src/engine/physics/cloth/collider/ClothColliderIndex.js +85 -67
- package/src/engine/physics/cloth/collider/cloth_collider_bounds.d.ts.map +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_bounds.js +19 -101
- package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts +2 -5
- package/src/engine/physics/cloth/collider/cloth_collider_pack.d.ts.map +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_pack.js +7 -15
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts.map +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +17 -62
- package/src/engine/physics/cloth/ecs/Cloth.d.ts +17 -9
- package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/Cloth.js +220 -212
- package/src/engine/physics/cloth/ecs/ClothColliderFlags.d.ts +0 -1
- package/src/engine/physics/cloth/ecs/ClothColliderFlags.js +6 -19
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts +1 -2
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothColliderSystem.js +3 -12
- package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +6 -0
- package/src/engine/physics/cloth/ecs/ClothHold.d.ts +91 -0
- package/src/engine/physics/cloth/ecs/ClothHold.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothHold.js +103 -0
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +254 -48
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothInstance.js +277 -47
- package/src/engine/physics/cloth/ecs/ClothPin.d.ts +73 -0
- package/src/engine/physics/cloth/ecs/ClothPin.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothPin.js +92 -0
- package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts +36 -0
- package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.js +61 -0
- package/src/engine/physics/cloth/ecs/ClothRig.d.ts +23 -17
- package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothRig.js +29 -27
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +12 -14
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothSystem.js +20 -15
- package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +57 -36
- package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothWorld.js +754 -207
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +12 -13
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +20 -14
- package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +63 -11
- package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_build_rows.js +297 -101
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +9 -7
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +12 -10
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +3 -3
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +60 -120
- package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +37 -0
- package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_geodesic.js +135 -0
- package/src/engine/physics/cloth/ecs/cloth_holds.d.ts +97 -0
- package/src/engine/physics/cloth/ecs/cloth_holds.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_holds.js +583 -0
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +2 -2
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +168 -51
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +17 -22
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +55 -117
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +21 -6
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +51 -42
- package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +5 -0
- package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_write_back.js +62 -50
- package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +65 -58
- package/src/engine/physics/cloth/playground/cloth_playground_build.d.ts.map +1 -1
- package/src/engine/physics/cloth/playground/cloth_playground_build.js +2 -3
- package/src/engine/physics/cloth/playground/collide_main.js +3 -29
- package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -1
- package/src/engine/physics/cloth/playground/garment_build.js +17 -5
- package/src/engine/physics/cloth/playground/garment_main.js +5 -20
- package/src/engine/physics/cloth/playground/main.js +6 -48
- package/src/engine/physics/cloth/playground/rig_build.d.ts.map +1 -1
- package/src/engine/physics/cloth/playground/rig_build.js +302 -296
- package/src/engine/physics/cloth/playground/rig_main.js +947 -955
- package/src/engine/physics/cloth/playground/wind_main.js +8 -7
- package/src/engine/physics/cloth/solver/ClothState.d.ts +45 -7
- package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/ClothState.js +79 -83
- package/src/engine/physics/cloth/solver/cloth_color_particles.d.ts +10 -8
- package/src/engine/physics/cloth/solver/cloth_color_particles.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_color_particles.js +30 -102
- package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +6 -1
- package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_contact_find.js +9 -3
- package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts +114 -0
- package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_hold_line.js +350 -0
- package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts +21 -0
- package/src/engine/physics/cloth/solver/cloth_kinetic_energy.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_kinetic_energy.js +45 -0
- package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts +32 -0
- package/src/engine/physics/cloth/solver/cloth_particle_coupling.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_particle_coupling.js +133 -0
- package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts +16 -0
- package/src/engine/physics/cloth/solver/cloth_particle_of_source.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_particle_of_source.js +19 -0
- package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +6 -2
- package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_self_find.js +19 -68
- package/src/engine/physics/cloth/solver/cloth_solve_vertex.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_solve_vertex.js +30 -65
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +24 -12
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_solver_constants.js +24 -12
- package/src/engine/physics/cloth/solver/cloth_step.d.ts +16 -0
- package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step.js +189 -48
- package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +1 -0
- package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step_instance.js +12 -6
- package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts +21 -0
- package/src/engine/physics/cloth/solver/cloth_stretch_residual.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_stretch_residual.js +54 -0
- package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts +15 -0
- package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_vertex_accumulator.js +28 -0
- package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts +30 -0
- package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_worst_tether_ratio.js +56 -0
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +3 -17
- package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.js +353 -346
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +7 -5
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +7 -5
- package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +2 -1
- package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -1
- package/src/engine/physics/cloth/wind/ClothFluidWind.js +7 -25
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +12 -10
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
- package/src/engine/physics/cloth/wind/cloth_sample_air.js +60 -82
- package/src/engine/physics/ecs/ContactProbeSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/ContactProbeSystem.js +2 -18
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +9 -50
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts +24 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_domain_bounds.js +42 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts +25 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid_sample_velocity_world_mps.js +40 -0
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.d.ts.map +1 -1
- package/src/engine/physics/inverse_kinematics/frame_fabrik/frame_fabrik_solve.js +40 -90
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/capsule_contacts.js +3 -5
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +2 -14
- package/src/engine/physics/narrowphase/hull_sphere_contact.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/hull_sphere_contact.js +2 -5
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/narrowphase_step.js +13 -32
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/sphere_box_contact.js +2 -5
- package/src/engine/simulation/Ticker.d.ts +13 -0
- package/src/engine/simulation/Ticker.d.ts.map +1 -1
- package/src/engine/simulation/Ticker.js +43 -8
- package/src/format/texture/basis/transcode/etc1s_to_astc.d.ts.map +1 -1
- package/src/format/texture/basis/transcode/etc1s_to_astc.js +2 -1
- package/src/shade/RENDERER_CONTRACT.md +8 -2
- package/src/shade/playground/image_decode_bench/main.js +2 -1
- package/src/shade/playground/mesh_row_ceiling/main.js +2 -1
- package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +2 -1
- package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/main.js +11 -19
- package/src/shade/playground/skinned_blas_refit/place_character.d.ts +6 -3
- package/src/shade/playground/skinned_blas_refit/place_character.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/place_character.js +90 -90
- package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_mesh_soup/main.js +502 -509
- package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.d.ts.map +1 -1
- package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.js +2 -1
- package/src/shade/playground/ssr_variance/statistics.d.ts.map +1 -1
- package/src/shade/playground/ssr_variance/statistics.js +2 -1
- package/src/shade/playground/texture_encode/README.md +129 -109
- package/src/shade/playground/texture_encode/main.d.ts.map +1 -1
- package/src/shade/playground/texture_encode/main.js +1431 -1430
- package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
- package/src/shade/playground/volumetrics_froxel/measure.js +2 -1
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts +45 -14
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.js +316 -64
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +5 -0
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +11 -1
- package/src/shade/renderer/buffer/table/gpu_database_check_links.d.ts.map +1 -1
- package/src/shade/renderer/buffer/table/gpu_database_check_links.js +2 -1
- package/src/shade/renderer/geometry/BoxGeometry.d.ts +1 -11
- package/src/shade/renderer/geometry/BoxGeometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/BoxGeometry.js +6 -13
- package/src/shade/renderer/geometry/CapsuleGeometry.d.ts +19 -0
- package/src/shade/renderer/geometry/CapsuleGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/CapsuleGeometry.js +24 -0
- package/src/shade/renderer/geometry/ConeGeometry.d.ts +20 -0
- package/src/shade/renderer/geometry/ConeGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/ConeGeometry.js +33 -0
- package/src/shade/renderer/geometry/CylinderGeometry.d.ts +21 -0
- package/src/shade/renderer/geometry/CylinderGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/CylinderGeometry.js +35 -0
- package/src/shade/renderer/geometry/PlaneGeometry.d.ts +17 -0
- package/src/shade/renderer/geometry/PlaneGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/PlaneGeometry.js +22 -0
- package/src/shade/renderer/geometry/TorusGeometry.d.ts +18 -0
- package/src/shade/renderer/geometry/TorusGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/TorusGeometry.js +23 -0
- package/src/shade/renderer/geometry/UVSphereGeometry.d.ts +21 -0
- package/src/shade/renderer/geometry/UVSphereGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/UVSphereGeometry.js +34 -0
- package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts +19 -0
- package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/primitives/make_capsule_geometry.js +205 -0
- package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts +21 -0
- package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/primitives/make_cone_geometry.js +36 -0
- package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts +1 -1
- package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.js +44 -9
- package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts +20 -0
- package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.js +190 -0
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +3 -2
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_leaf_frontier.js +2 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_partition_into_groups.js +2 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_run_round.js +2 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.js +3 -2
- package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.js +2 -1
- package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.js +2 -1
- package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.js +3 -2
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -2
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +26 -8
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +56 -39
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts +7 -0
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js +46 -4
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js +4 -2
- package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +2 -2
- package/src/shade/renderer/gpu_primitive/sort/defs.js +79 -79
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +1 -1
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +7 -3
- package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +4 -3
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +200 -194
- package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles.js +6 -2
- package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.d.ts.map +1 -1
- package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.js +3 -2
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +334 -329
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +7 -2
- package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +16 -4
- package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2444 -2345
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +312 -310
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +3 -3
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +383 -375
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +349 -346
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +58 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +536 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +21 -7
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +291 -327
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts +25 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.js +99 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +5 -3
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +47 -71
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts +10 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +50 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +4 -5
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +7 -8
- package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
- package/src/shade/renderer/water/chunk_water_transport.js +7 -5
- package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
- package/src/shade/renderer/water/medium/GPUWaterBodies.js +8 -2
- package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts +3 -2
- package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts.map +1 -1
- package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.js +3 -2
- package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
- package/src/shade/renderer/water/shader_water.js +3 -1
- package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/GPUWaterSurface.js +3 -1
- package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/graph_water_tessellation.js +11 -4
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +37 -20
- package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
- package/src/shade/wgsl/validate_wgsl_source.js +74 -3
- package/src/engine/graphics3/register_instance_animation.d.ts +0 -114
- package/src/engine/graphics3/register_instance_animation.d.ts.map +0 -1
- package/src/engine/graphics3/register_instance_animation.js +0 -201
|
@@ -5,6 +5,7 @@ import { vgeo_build_group_step } from "./vgeo_build_group_step.js";
|
|
|
5
5
|
import { vgeo_error_bands } from "./vgeo_error_bands.js";
|
|
6
6
|
import { vgeo_partition_into_groups } from "./vgeo_partition_into_groups.js";
|
|
7
7
|
import { vgeo_try_repack } from "./vgeo_try_repack.js";
|
|
8
|
+
import { number_compare_ascending } from "../../../../../../core/primitives/numbers/number_compare_ascending.js";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* The frontier's clusters ordered by error, which is what a band is a slice of.
|
|
@@ -65,7 +66,7 @@ export function vgeo_run_round(frontier, level, options) {
|
|
|
65
66
|
for (const range of bands) {
|
|
66
67
|
const band = ordered.order.slice(range.start, range.end);
|
|
67
68
|
|
|
68
|
-
band.sort(
|
|
69
|
+
band.sort(number_compare_ascending);
|
|
69
70
|
|
|
70
71
|
const groups = vgeo_partition_into_groups(frontier, band, cluster_graph, group_size);
|
|
71
72
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vgeo_try_repack.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vgeo_try_repack.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/build/level/vgeo_try_repack.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wEAPW,MAAM,EAAE,iBACR,MAAM,GACJ,eAAe,GAAC,SAAS,CAsFrC;gCA9G+B,sBAAsB"}
|
|
@@ -6,6 +6,7 @@ import { vgeo_split_face_set_packed } from "../partition/vgeo_split_face_set_pac
|
|
|
6
6
|
import { vgeo_extract_submesh } from "../submesh/vgeo_extract_submesh.js";
|
|
7
7
|
import { vgeo_build_cluster } from "./vgeo_build_cluster.js";
|
|
8
8
|
import { VGeoGroupRepack } from "./VGeoGroupRepack.js";
|
|
9
|
+
import { number_compare_ascending } from "../../../../../../core/primitives/numbers/number_compare_ascending.js";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Leaves with room to spare between them, re-cut into fewer and fuller leaves.
|
|
@@ -53,7 +54,7 @@ export function vgeo_try_repack(frontier, group_clusters, parent_target) {
|
|
|
53
54
|
return undefined;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
face_ids.sort(
|
|
57
|
+
face_ids.sort(number_compare_ascending);
|
|
57
58
|
|
|
58
59
|
const submesh = vgeo_extract_submesh(frontier.mesh, face_ids, frontier.wedges);
|
|
59
60
|
|
|
@@ -88,7 +89,7 @@ export function vgeo_try_repack(frontier, group_clusters, parent_target) {
|
|
|
88
89
|
for (const part of parts) {
|
|
89
90
|
const part_face_ids = part.map((dense) => face_graph.vertex_face_ids[dense]);
|
|
90
91
|
|
|
91
|
-
part_face_ids.sort(
|
|
92
|
+
part_face_ids.sort(number_compare_ascending);
|
|
92
93
|
|
|
93
94
|
const built = vgeo_build_cluster(submesh.mesh, part_face_ids, 0, submesh.wedges);
|
|
94
95
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vgeo_graph_components.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vgeo_graph_components.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/build/partition/vgeo_graph_components.js"],"names":[],"mappings":"AA8CA;;;;;;;;;;;GAWG;AACH,sDARW,WAAW,aACX,WAAW,WACX,MAAM,EAAE,cACR,UAAU,SAEV,MAAM,GACJ,MAAM,EAAE,EAAE,CAmEtB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { number_compare_ascending } from "../../../../../../core/primitives/numbers/number_compare_ascending.js";
|
|
1
2
|
/**
|
|
2
3
|
* Connected components of the subgraph a CSR induces on a member set.
|
|
3
4
|
*
|
|
@@ -112,7 +113,7 @@ export function vgeo_graph_components(
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
|
|
115
|
-
component.sort(
|
|
116
|
+
component.sort(number_compare_ascending);
|
|
116
117
|
|
|
117
118
|
result.push(component);
|
|
118
119
|
}
|
package/src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vgeo_split_face_set_packed.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vgeo_split_face_set_packed.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/build/partition/vgeo_split_face_set_packed.js"],"names":[],"mappings":"AAoVA;;;;;;;;;;;;GAYG;AACH,+EALW,MAAM,EAAE,aACR,MAAM,gBACN,MAAM,GACJ,MAAM,EAAE,EAAE,CAoBtB"}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
bt_face_read_triangle_vertices
|
|
5
5
|
} from "../../../../../../core/geom/3d/topology/struct/binary/query/bt_face_read_triangle.js";
|
|
6
6
|
import { vgeo_split_face_set } from "./vgeo_split_face_set.js";
|
|
7
|
+
import { number_compare_ascending } from "../../../../../../core/primitives/numbers/number_compare_ascending.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* {@link vgeo_split_face_set}, then merge the under-filled pieces it left behind.
|
|
@@ -331,7 +332,7 @@ function pack_pieces(face_graph, pieces, max_faces, max_vertices, floor) {
|
|
|
331
332
|
}
|
|
332
333
|
}
|
|
333
334
|
|
|
334
|
-
packed.sort(
|
|
335
|
+
packed.sort(number_compare_ascending);
|
|
335
336
|
|
|
336
337
|
return packed;
|
|
337
338
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vgeo_write_container.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/format/vgeo_write_container.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vgeo_write_container.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/format/vgeo_write_container.js"],"names":[],"mappings":"AAmfA;;;;;;;;GAQG;AACH,4CANW,qBAAqB,8BAGnB,QAAQ,YAAY,CAAC,CAmOjC;6BA3tB4B,4CAA4C"}
|
|
@@ -41,6 +41,7 @@ import { VGEO_PARENT_PAGE_ENTRY_SIZE } from "./page/VGEO_PARENT_PAGE_ENTRY_SIZE.
|
|
|
41
41
|
import { VGEO_PAYLOAD_ENCODING_SHADE_MESHLET_V1 } from "./header/VGEO_PAYLOAD_ENCODING_SHADE_MESHLET_V1.js";
|
|
42
42
|
import { VGEO_SAME_PAGE } from "./cluster/VGEO_SAME_PAGE.js";
|
|
43
43
|
import { vgeo_scan_frames } from "./frame/vgeo_scan_frames.js";
|
|
44
|
+
import { number_compare_ascending } from "../../../../../core/primitives/numbers/number_compare_ascending.js";
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* Serialize an assembled page list into `.vgeo` bytes.
|
|
@@ -182,7 +183,7 @@ function collect_parent_pages(page, parents) {
|
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
185
|
|
|
185
|
-
return Array.from(seen).sort(
|
|
186
|
+
return Array.from(seen).sort(number_compare_ascending);
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
/**
|
|
@@ -206,7 +207,7 @@ function collect_child_pages(page) {
|
|
|
206
207
|
}
|
|
207
208
|
}
|
|
208
209
|
|
|
209
|
-
return Array.from(seen).sort(
|
|
210
|
+
return Array.from(seen).sort(number_compare_ascending);
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
/**
|
package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_vgeo_expand_instances_to_meshlets.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph_vgeo_expand_instances_to_meshlets.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH;IAX+B,KAAK;IACT,YAAY,EAA5B,MAAM;IACU,eAAe,EAA/B,MAAM;IACkB,IAAI;IACO,OAAO;IACb,MAAM;IACjC,MAAM,CA6TlB"}
|
package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js
CHANGED
|
@@ -5,8 +5,12 @@ import {
|
|
|
5
5
|
graph_build_indirect_dispatch_command,
|
|
6
6
|
INDIRECT_COMPUTE_COMMAND_DESCRIPTOR
|
|
7
7
|
} from "../../../gpu_primitive/indirect/IndirectComputeCommandBuildPass.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
graph_prefix_scan_csdldf,
|
|
10
|
+
prefix_scan_csdldf_output_descriptor
|
|
11
|
+
} from "../../../gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js";
|
|
9
12
|
import { RasterizationCollectionType } from "../../../rasterize/expand/RasterizationCollectionType.js";
|
|
13
|
+
import { graph_create_buffer } from "../../../shader/graph/graph_create_buffer.js";
|
|
10
14
|
import { shader_vgeo_cut_collect } from "./cut/shader_vgeo_cut_collect.js";
|
|
11
15
|
import { shader_vgeo_cut_queue_prepare } from "./cut/shader_vgeo_cut_queue_prepare.js";
|
|
12
16
|
import { shader_vgeo_cut_queue_remainder } from "./cut/shader_vgeo_cut_queue_remainder.js";
|
|
@@ -186,7 +190,8 @@ export function graph_vgeo_expand_instances_to_meshlets({
|
|
|
186
190
|
*/
|
|
187
191
|
const prefix_sums = graph_prefix_scan_csdldf({
|
|
188
192
|
graph,
|
|
189
|
-
|
|
193
|
+
input: collect_data.claim_widths,
|
|
194
|
+
output: graph_create_buffer(graph, "vg claim offsets", prefix_scan_csdldf_output_descriptor(instance_capacity)),
|
|
190
195
|
element_max_count: instance_capacity,
|
|
191
196
|
});
|
|
192
197
|
|
|
@@ -1,25 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A transient {@link graph_prefix_scan_csdldf} output for up to `element_max_count` elements: the count, padded to 16
|
|
3
|
+
* bytes, then the sums in whole vec4 blocks. The scan writes the count itself, so nothing needs clearing.
|
|
4
|
+
*
|
|
5
|
+
* @param {number} element_max_count
|
|
6
|
+
* @returns {BufferResourceDescriptor}
|
|
7
|
+
*/
|
|
8
|
+
export function prefix_scan_csdldf_output_descriptor(element_max_count: number): BufferResourceDescriptor;
|
|
1
9
|
/**
|
|
2
10
|
* Indirect pass.
|
|
3
|
-
*
|
|
11
|
+
* Inclusive prefix sums of `input` into `output`.
|
|
12
|
+
* Both are expected in the form:
|
|
4
13
|
* ```wgsl
|
|
5
14
|
* struct InputData{
|
|
6
15
|
* count:u32,
|
|
7
16
|
* elements: array<u32> // counts: [count0, count1, count2, ... countN-1]
|
|
8
17
|
* }
|
|
9
18
|
* ```
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
19
|
+
* `output` receives the input's count and, for each of its elements, the sum of the elements up to and including it.
|
|
20
|
+
* `input` is never written: the scan's fallback re-reads a tile's inputs while other tiles are writing their sums, so
|
|
21
|
+
* the two cannot be one buffer.
|
|
22
|
+
*
|
|
23
|
+
* The work follows the input's count, read on the device; `element_max_count` sizes only the memory — the spine, and
|
|
24
|
+
* what `output` must hold — so make it at least the most elements the input can carry, otherwise an incomplete scan will
|
|
25
|
+
* be performed. Where a count records demand and runs past a soft limit — a culled collection does — that is what the
|
|
26
|
+
* buffer holds, not the limit. The penalty for `element_max_count` being too big is fairly small: a larger spine to clear.
|
|
13
27
|
*
|
|
14
28
|
* @param {Object} options
|
|
15
29
|
* @param {FrameGraph} options.graph
|
|
16
|
-
* @param {number} options.
|
|
30
|
+
* @param {number} options.input buffer resource ID, array<u32> first position must be "count". The buffer must be 16-byte aligned.
|
|
31
|
+
* @param {number} options.output buffer resource ID of the same layout, at least `16 + ⌈element_max_count / 4⌉ · 16` bytes;
|
|
32
|
+
* see {@link prefix_scan_csdldf_output_descriptor}
|
|
17
33
|
* @param {number} [options.element_max_count=1,048,576] how many elements might be in the input, this is a limit
|
|
18
|
-
* @returns {number} buffer resource ID
|
|
34
|
+
* @returns {number} buffer resource ID of the written output
|
|
19
35
|
*/
|
|
20
|
-
export function graph_prefix_scan_csdldf({ graph,
|
|
36
|
+
export function graph_prefix_scan_csdldf({ graph, input, output, element_max_count, }: {
|
|
21
37
|
graph: FrameGraph;
|
|
22
|
-
|
|
38
|
+
input: number;
|
|
39
|
+
output: number;
|
|
23
40
|
element_max_count?: number;
|
|
24
41
|
}): number;
|
|
42
|
+
import { BufferResourceDescriptor } from "../../../../device/graph/BufferResourceDescriptor.js";
|
|
25
43
|
//# sourceMappingURL=graph_prefix_scan_csdldf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_prefix_scan_csdldf.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph_prefix_scan_csdldf.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,wEAHW,MAAM,GACJ,wBAAwB,CAMpC;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAP+B,KAAK;IACT,KAAK,EAArB,MAAM;IACU,MAAM,EAAtB,MAAM;IAEW,iBAAiB,GAAlC,MAAM;IACJ,MAAM,CAwElB;yCA3HwC,sDAAsD"}
|
|
@@ -3,51 +3,74 @@ import { round_up } from "../../../../../core/math/round_up.js";
|
|
|
3
3
|
import { warn_limited } from "../../../../util/warn_limited.js";
|
|
4
4
|
import { BufferResourceDescriptor } from "../../../../device/graph/BufferResourceDescriptor.js";
|
|
5
5
|
import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
6
|
+
import { INDIRECT_COMPUTE_COMMAND_DESCRIPTOR } from "../../indirect/IndirectComputeCommandBuildPass.js";
|
|
6
7
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION
|
|
9
|
+
} from "../../indirect/WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION.js";
|
|
10
|
+
import {
|
|
11
|
+
PREFIX_SCAN_CSDLDF_PARTITION_SIZE,
|
|
12
|
+
shader_prefix_scan_csdldf,
|
|
13
|
+
shader_prefix_scan_csdldf_prepare
|
|
14
|
+
} from "./shader_prefix_scan_csdldf.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A transient {@link graph_prefix_scan_csdldf} output for up to `element_max_count` elements: the count, padded to 16
|
|
18
|
+
* bytes, then the sums in whole vec4 blocks. The scan writes the count itself, so nothing needs clearing.
|
|
19
|
+
*
|
|
20
|
+
* @param {number} element_max_count
|
|
21
|
+
* @returns {BufferResourceDescriptor}
|
|
22
|
+
*/
|
|
23
|
+
export function prefix_scan_csdldf_output_descriptor(element_max_count) {
|
|
24
|
+
assert.isNonNegativeInteger(element_max_count, 'element_max_count');
|
|
25
|
+
|
|
26
|
+
return BufferResourceDescriptor.from(16 + Math.max(1, Math.ceil(element_max_count / 4)) * 16, GPUBufferUsage.STORAGE);
|
|
27
|
+
}
|
|
11
28
|
|
|
12
29
|
|
|
13
30
|
/**
|
|
14
31
|
* Indirect pass.
|
|
15
|
-
*
|
|
32
|
+
* Inclusive prefix sums of `input` into `output`.
|
|
33
|
+
* Both are expected in the form:
|
|
16
34
|
* ```wgsl
|
|
17
35
|
* struct InputData{
|
|
18
36
|
* count:u32,
|
|
19
37
|
* elements: array<u32> // counts: [count0, count1, count2, ... countN-1]
|
|
20
38
|
* }
|
|
21
39
|
* ```
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
40
|
+
* `output` receives the input's count and, for each of its elements, the sum of the elements up to and including it.
|
|
41
|
+
* `input` is never written: the scan's fallback re-reads a tile's inputs while other tiles are writing their sums, so
|
|
42
|
+
* the two cannot be one buffer.
|
|
43
|
+
*
|
|
44
|
+
* The work follows the input's count, read on the device; `element_max_count` sizes only the memory — the spine, and
|
|
45
|
+
* what `output` must hold — so make it at least the most elements the input can carry, otherwise an incomplete scan will
|
|
46
|
+
* be performed. Where a count records demand and runs past a soft limit — a culled collection does — that is what the
|
|
47
|
+
* buffer holds, not the limit. The penalty for `element_max_count` being too big is fairly small: a larger spine to clear.
|
|
25
48
|
*
|
|
26
49
|
* @param {Object} options
|
|
27
50
|
* @param {FrameGraph} options.graph
|
|
28
|
-
* @param {number} options.
|
|
51
|
+
* @param {number} options.input buffer resource ID, array<u32> first position must be "count". The buffer must be 16-byte aligned.
|
|
52
|
+
* @param {number} options.output buffer resource ID of the same layout, at least `16 + ⌈element_max_count / 4⌉ · 16` bytes;
|
|
53
|
+
* see {@link prefix_scan_csdldf_output_descriptor}
|
|
29
54
|
* @param {number} [options.element_max_count=1,048,576] how many elements might be in the input, this is a limit
|
|
30
|
-
* @returns {number} buffer resource ID
|
|
55
|
+
* @returns {number} buffer resource ID of the written output
|
|
31
56
|
*/
|
|
32
57
|
export function graph_prefix_scan_csdldf({
|
|
33
58
|
graph,
|
|
34
|
-
|
|
59
|
+
input,
|
|
60
|
+
output,
|
|
35
61
|
element_max_count = 1048576,
|
|
36
62
|
}) {
|
|
37
63
|
|
|
38
64
|
assert.isNonNegativeInteger(element_max_count, 'element_max_count');
|
|
39
65
|
|
|
40
|
-
if (element_max_count <= 0) {
|
|
41
|
-
console.warn("element_max_count <= 0, returning input");
|
|
42
|
-
|
|
43
|
-
return data;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
66
|
// TODO run a special prefix scan if element_max_count fits into a single group
|
|
47
67
|
|
|
48
|
-
|
|
49
68
|
const group_count = Math.ceil(element_max_count / PREFIX_SCAN_CSDLDF_PARTITION_SIZE);
|
|
50
69
|
|
|
70
|
+
if (group_count > WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION) {
|
|
71
|
+
warn_limited(`group_count(=${group_count} > MAX_DISPATCH_SIZE(=${WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION}). Prefix scan likely incomplete`);
|
|
72
|
+
}
|
|
73
|
+
|
|
51
74
|
const pass_data = {};
|
|
52
75
|
|
|
53
76
|
/**
|
|
@@ -58,41 +81,35 @@ export function graph_prefix_scan_csdldf({
|
|
|
58
81
|
*/
|
|
59
82
|
function execute(pass_data, resources, context) {
|
|
60
83
|
|
|
61
|
-
const data = resources.get(pass_data.data);
|
|
62
|
-
const partition_descriptor_buffer = resources.get(pass_data.partition_descriptor_buffer);
|
|
63
|
-
const command = resources.get(pass_data.command);
|
|
64
|
-
|
|
65
84
|
const encoder = context.encoder;
|
|
66
85
|
|
|
67
|
-
const
|
|
86
|
+
const scan_in = resources.get(pass_data.input);
|
|
87
|
+
const scan_out = resources.get(pass_data.output);
|
|
88
|
+
const command = resources.get(pass_data.command);
|
|
68
89
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
90
|
+
assert.notEqual(scan_in, scan_out, 'input and output must be different buffers');
|
|
91
|
+
assert.greaterThanOrEqual(scan_out.size, 16 + Math.ceil(element_max_count / 4) * 16, 'output is too small for element_max_count');
|
|
72
92
|
|
|
73
|
-
|
|
74
|
-
PREFIX_SCAN_CSDLDF_PARTITION_SIZE,
|
|
93
|
+
shader_prefix_scan_csdldf_prepare.dispatch({
|
|
75
94
|
encoder,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
command,
|
|
79
|
-
0,
|
|
80
|
-
);
|
|
95
|
+
bindings: { scan_in, scan_out, command },
|
|
96
|
+
});
|
|
81
97
|
|
|
82
98
|
shader_prefix_scan_csdldf.dispatchIndirect({
|
|
83
99
|
encoder,
|
|
84
100
|
command,
|
|
85
101
|
bindings: {
|
|
86
|
-
scan_in
|
|
87
|
-
|
|
102
|
+
scan_in,
|
|
103
|
+
scan_out,
|
|
104
|
+
spine: resources.get(pass_data.partition_descriptor_buffer),
|
|
88
105
|
}
|
|
89
106
|
});
|
|
90
107
|
}
|
|
91
108
|
|
|
92
109
|
const pass = graph.add("prefix sum", pass_data, execute);
|
|
93
110
|
|
|
94
|
-
pass.read(
|
|
95
|
-
pass_data.
|
|
111
|
+
pass_data.input = pass.read(input);
|
|
112
|
+
pass_data.output = pass.write(pass.read(output));
|
|
96
113
|
|
|
97
114
|
pass_data.command = pass.create("command", INDIRECT_COMPUTE_COMMAND_DESCRIPTOR);
|
|
98
115
|
|
|
@@ -106,5 +123,5 @@ export function graph_prefix_scan_csdldf({
|
|
|
106
123
|
)
|
|
107
124
|
);
|
|
108
125
|
|
|
109
|
-
return pass_data.
|
|
110
|
-
}
|
|
126
|
+
return pass_data.output;
|
|
127
|
+
}
|
|
@@ -23,5 +23,12 @@ export const PREFIX_SCAN_CSDLDF_HEADER_WORDS: number;
|
|
|
23
23
|
* @type {ComputeShader}
|
|
24
24
|
*/
|
|
25
25
|
export const shader_prefix_scan_csdldf: ComputeShader;
|
|
26
|
+
/**
|
|
27
|
+
* One thread ahead of {@link shader_prefix_scan_csdldf}: the scan's dispatch, a workgroup per partition of the input's
|
|
28
|
+
* count, and the output's count. The output gets its count here rather than from the scan's first tile because an input
|
|
29
|
+
* of no elements dispatches no tile at all.
|
|
30
|
+
* @type {ComputeShader}
|
|
31
|
+
*/
|
|
32
|
+
export const shader_prefix_scan_csdldf_prepare: ComputeShader;
|
|
26
33
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
27
34
|
//# sourceMappingURL=shader_prefix_scan_csdldf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_prefix_scan_csdldf.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_prefix_scan_csdldf.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,gDAFU,MAAM,CAEsC;AAOtD;;;;;;;;;;GAUG;AACH,8CAFU,MAAM,CAE6E;AAmT7F;;;;;GAKG;AACH,wCAFU,aAAa,CAMpB;AAQH;;;;;GAKG;AACH,gDAFU,aAAa,CAkBpB;8BArX2B,kCAAkC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { WebGPUExtensionType } from "../../../../descriptor/WebGPUExtensionType.js";
|
|
2
|
+
import {
|
|
3
|
+
WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION
|
|
4
|
+
} from "../../indirect/WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION.js";
|
|
2
5
|
import { atomic_u32, u32, vec4u } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
3
6
|
import { WebGPUArray } from "../../../shader/type/WebGPUArray.js";
|
|
4
7
|
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
@@ -32,9 +35,18 @@ const DATA_STRUCT = WebGPUStruct.from({
|
|
|
32
35
|
*/
|
|
33
36
|
export const PREFIX_SCAN_CSDLDF_HEADER_WORDS = DATA_STRUCT.get("elements").offset / u32.size;
|
|
34
37
|
|
|
38
|
+
/*
|
|
39
|
+
The input is bound read-only and the sums go to a buffer of their own, as in both references: a tile that does not see
|
|
40
|
+
its predecessor's flag within MAX_SPIN_COUNT re-reduces the predecessor's elements itself (the fallback), so those
|
|
41
|
+
elements must still be the inputs while any tile of the dispatch runs. Scanned in place, a predecessor that had already
|
|
42
|
+
written its sums handed the fallback a mix of inputs and sums, and the tiles after it carried the difference: on an
|
|
43
|
+
RTX 4090 one scan of 3,100 came back wrong (196,608 elements, tiles 5–12 all off by 33,721,938), and with
|
|
44
|
+
MAX_SPIN_COUNT at 1, 65 of 500.
|
|
45
|
+
*/
|
|
35
46
|
const resources = new ShaderResourceSetDescriptor();
|
|
36
47
|
resources.createGroup()
|
|
37
|
-
.addStorageBuffer("scan_in", DATA_STRUCT
|
|
48
|
+
.addStorageBuffer("scan_in", DATA_STRUCT)
|
|
49
|
+
.addStorageBuffer("scan_out", DATA_STRUCT, true)
|
|
38
50
|
.addStorageBuffer("spine", WebGPUArray.from(WebGPUArray.from(atomic_u32, 2)), true)
|
|
39
51
|
|
|
40
52
|
const body = CodeChunk.from(
|
|
@@ -93,7 +105,7 @@ fn main(
|
|
|
93
105
|
@builtin(subgroup_invocation_id) lane_id: u32,
|
|
94
106
|
@builtin(subgroup_size) lane_count: u32,
|
|
95
107
|
) {
|
|
96
|
-
|
|
108
|
+
|
|
97
109
|
let vec_size = divide_round_up_u32(scan_in.count, 4);
|
|
98
110
|
let work_tiles = divide_round_up_u32(scan_in.count, ${PREFIX_SCAN_CSDLDF_PARTITION_SIZE});
|
|
99
111
|
|
|
@@ -306,7 +318,7 @@ fn main(
|
|
|
306
318
|
let prev = wg_broadcast + select(0u, wg_partials[subgroup_id - 1u], subgroup_id != 0u); //wg_broadcast is 0 for tile_id 0
|
|
307
319
|
if(tile_id < work_tiles - 1u){
|
|
308
320
|
for(var k = 0u; k < VEC4_SPT; k += 1u){
|
|
309
|
-
|
|
321
|
+
scan_out.elements[i] = t_scan[k] + prev;
|
|
310
322
|
i += lane_count;
|
|
311
323
|
}
|
|
312
324
|
}
|
|
@@ -314,7 +326,7 @@ fn main(
|
|
|
314
326
|
if(tile_id == work_tiles - 1u){
|
|
315
327
|
for(var k = 0u; k < VEC4_SPT; k += 1u){
|
|
316
328
|
if(i < vec_size){
|
|
317
|
-
|
|
329
|
+
scan_out.elements[i] = t_scan[k] + prev;
|
|
318
330
|
}
|
|
319
331
|
i += lane_count;
|
|
320
332
|
}
|
|
@@ -338,4 +350,34 @@ export const shader_prefix_scan_csdldf = ComputeShader.from({
|
|
|
338
350
|
label: "Prefix Scan / CSDLDF",
|
|
339
351
|
body,
|
|
340
352
|
resources,
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
const prepare_resources = new ShaderResourceSetDescriptor();
|
|
356
|
+
prepare_resources.createGroup()
|
|
357
|
+
.addStorageBuffer("scan_in", DATA_STRUCT)
|
|
358
|
+
.addStorageBuffer("scan_out", DATA_STRUCT, true)
|
|
359
|
+
.addStorageBuffer("command", WebGPUArray.u32, true);
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* One thread ahead of {@link shader_prefix_scan_csdldf}: the scan's dispatch, a workgroup per partition of the input's
|
|
363
|
+
* count, and the output's count. The output gets its count here rather than from the scan's first tile because an input
|
|
364
|
+
* of no elements dispatches no tile at all.
|
|
365
|
+
* @type {ComputeShader}
|
|
366
|
+
*/
|
|
367
|
+
export const shader_prefix_scan_csdldf_prepare = ComputeShader.from({
|
|
368
|
+
label: "Prefix Scan / CSDLDF prepare",
|
|
369
|
+
resources: prepare_resources,
|
|
370
|
+
body: CodeChunk.from(
|
|
371
|
+
//language=WGSL
|
|
372
|
+
`
|
|
373
|
+
@compute @workgroup_size(1)
|
|
374
|
+
fn main() {
|
|
375
|
+
let count = scan_in.count;
|
|
376
|
+
scan_out.count = count;
|
|
377
|
+
// the scan reads its tile from workgroup_id.x alone; past one dimension's guaranteed width it is incomplete
|
|
378
|
+
command[0] = min(divide_round_up_u32(count, ${PREFIX_SCAN_CSDLDF_PARTITION_SIZE}u), ${WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION}u);
|
|
379
|
+
command[1] = 1u;
|
|
380
|
+
command[2] = 1u;
|
|
381
|
+
}
|
|
382
|
+
`, [chunk_divide_round_up_u32]),
|
|
341
383
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test_prefix_sum.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test_prefix_sum.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js"],"names":[],"mappings":"AA4BA;;;GAGG;AACH,0EA+DC"}
|
|
@@ -12,7 +12,8 @@ import { WGSLAttributes } from "../../../shader/type/WGSLAttributes.js";
|
|
|
12
12
|
import { WGSLStructField } from "../../../shader/type/WGSLStructField.js";
|
|
13
13
|
import { graph_inspect_gpu_buffer } from "../../../buffer/graph_inspect_gpu_buffer.js";
|
|
14
14
|
import { graph_import_typed_buffer } from "../../../shader/graph/graph_import_typed_buffer.js";
|
|
15
|
-
import {
|
|
15
|
+
import { graph_create_buffer } from "../../../shader/graph/graph_create_buffer.js";
|
|
16
|
+
import { graph_prefix_scan_csdldf, prefix_scan_csdldf_output_descriptor } from "./graph_prefix_scan_csdldf.js";
|
|
16
17
|
|
|
17
18
|
function cpu_prefix_sum(input) {
|
|
18
19
|
const output = new Uint32Array(input.length);
|
|
@@ -57,7 +58,8 @@ export async function test_prefix_sum(graphics) {
|
|
|
57
58
|
|
|
58
59
|
const prefix_sum = graph_prefix_scan_csdldf({
|
|
59
60
|
graph,
|
|
60
|
-
data,
|
|
61
|
+
input: data,
|
|
62
|
+
output: graph_create_buffer(graph, "prefix sum", prefix_scan_csdldf_output_descriptor(input.length)),
|
|
61
63
|
element_max_count: input.length,
|
|
62
64
|
});
|
|
63
65
|
|
|
@@ -63,8 +63,8 @@ export const MAX_SUBGROUPS_PER_WORKGROUP: number;
|
|
|
63
63
|
* Words of `{count: u32, elements: array<vec4u>}` header that sit in front of the spine's elements.
|
|
64
64
|
*
|
|
65
65
|
* {@link graph_prefix_scan_csdldf} reads its element count from word 0 and its `elements` member is
|
|
66
|
-
* `@align(16)`, so the first count word lives at word 4. The histogram
|
|
67
|
-
*
|
|
66
|
+
* `@align(16)`, so the first count word lives at word 4. The histogram shader binds the spine flat and
|
|
67
|
+
* the scatter its scan, laid out the same, and both have to step over the header by hand.
|
|
68
68
|
* @type {number}
|
|
69
69
|
*/
|
|
70
70
|
export const SPINE_HEADER_WORDS: number;
|