bevy/crates/bevy_pbr/src/meshlet
JMS55 6e8d43a037
Faster MeshletMesh deserialization (#14193)
# Objective
- Using bincode to deserialize binary into a MeshletMesh is expensive
(~77ms for a 5mb file).

## Solution
- Write a custom deserializer using bytemuck's Pod types and slice
casting.
  - Total asset load time has gone from ~102ms to ~12ms.
- Change some types I never meant to be public to private and other misc
cleanup.

## Testing
- Ran the meshlet example and added timing spans to the asset loader.

---

## Changelog
- Improved `MeshletMesh` loading speed
- The `MeshletMesh` disk format has changed, and
`MESHLET_MESH_ASSET_VERSION` has been bumped
- `MeshletMesh` fields are now private
- Renamed `MeshletMeshSaverLoad` to `MeshletMeshSaverLoader`
- The `Meshlet`, `MeshletBoundingSpheres`, and `MeshletBoundingSphere`
types are now private
- Removed `MeshletMeshSaveOrLoadError::SerializationOrDeserialization`
- Added `MeshletMeshSaveOrLoadError::WrongFileType`

## Migration Guide
- Regenerate your `MeshletMesh` assets, as the disk format has changed,
and `MESHLET_MESH_ASSET_VERSION` has been bumped
- `MeshletMesh` fields are now private
- `MeshletMeshSaverLoad` is now named `MeshletMeshSaverLoader`
- The `Meshlet`, `MeshletBoundingSpheres`, and `MeshletBoundingSphere`
types are now private
- `MeshletMeshSaveOrLoadError::SerializationOrDeserialization` has been
removed
- Added `MeshletMeshSaveOrLoadError::WrongFileType`, match on this
variant if you match on `MeshletMeshSaveOrLoadError`
2024-07-15 15:06:02 +00:00
..
asset.rs Faster MeshletMesh deserialization (#14193) 2024-07-15 15:06:02 +00:00
copy_material_depth.wgsl Meshlet rendering (initial feature) (#10164) 2024-03-25 19:08:27 +00:00
cull_clusters.wgsl Fix incorrect computation of mips for cluster occlusion lookup (#14042) 2024-06-27 05:57:01 +00:00
downsample_depth.wgsl Meshlet single pass depth downsampling (SPD) (#13003) 2024-06-03 12:41:14 +00:00
dummy_visibility_buffer_resolve.wgsl Meshlet rendering (initial feature) (#10164) 2024-03-25 19:08:27 +00:00
fill_cluster_buffers.wgsl Meshlet single pass depth downsampling (SPD) (#13003) 2024-06-03 12:41:14 +00:00
from_mesh.rs Faster MeshletMesh deserialization (#14193) 2024-07-15 15:06:02 +00:00
gpu_scene.rs Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
material_draw_nodes.rs Fix meshlet interactions with regular shading passes (#13816) 2024-06-21 19:06:08 +00:00
material_draw_prepare.rs Fix meshlet interactions with regular shading passes (#13816) 2024-06-21 19:06:08 +00:00
meshlet_bindings.wgsl Meshlet remove per-cluster data upload (#13125) 2024-05-04 19:56:19 +00:00
meshlet_mesh_material.wgsl Meshlet misc (#13761) 2024-06-10 13:06:08 +00:00
meshlet_preview.png Meshlet rendering (initial feature) (#10164) 2024-03-25 19:08:27 +00:00
mod.rs Faster MeshletMesh deserialization (#14193) 2024-07-15 15:06:02 +00:00
persistent_buffer_impls.rs Meshlet continuous LOD (#12755) 2024-04-23 21:43:53 +00:00
persistent_buffer.rs Make PersistentGpuBufferable a safe trait (#12744) 2024-03-29 13:14:34 +00:00
pipelines.rs Misc meshlet changes (#13705) 2024-06-06 17:10:07 +00:00
visibility_buffer_raster_node.rs Meshlet single pass depth downsampling (SPD) (#13003) 2024-06-03 12:41:14 +00:00
visibility_buffer_raster.wgsl Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
visibility_buffer_resolve.wgsl Fix meshlet vertex attribute interpolation (#13775) 2024-06-10 20:18:43 +00:00