mirror of
https://github.com/bevyengine/bevy
synced 2025-01-13 05:38:54 +00:00
6465e3bd9f
# Objective - First step towards #15558 ## Solution - Rename `get_vertex_buffer_data` to `create_packed_vertex_buffer_data` to make it clear that it is not "free" and actually allocates - Compute length analytically for preallocation instead of creating the buffer to get its length and immediately discard it - Use existing vertex attribute size calculation method to reduce code duplication - Fix a bug where mesh index data was being replaced by unnecessarily newly created mesh vertex data in some cases - Overall reduces mesh copies by two. We still have plenty to go, but these were the easy ones. ## Testing - I ran 3d_scene, lighting, and many_cubes, they look fine. - Benchmarks would be nice, but this is very obviously a win in perf and correctness. --- ## Migration Guide - `Mesh::create_packed_vertex_buffer_data` has been renamed `Mesh::create_packed_vertex_buffer_data` to reflect the fact that it copies data and allocates. ## Showcase - look mom, less copies |
||
---|---|---|
.. | ||
asset.rs | ||
cull_clusters.wgsl | ||
downsample_depth.wgsl | ||
dummy_visibility_buffer_resolve.wgsl | ||
fill_cluster_buffers.wgsl | ||
from_mesh.rs | ||
instance_manager.rs | ||
material_pipeline_prepare.rs | ||
material_shade_nodes.rs | ||
meshlet_bindings.wgsl | ||
meshlet_mesh_manager.rs | ||
meshlet_mesh_material.wgsl | ||
meshlet_preview.png | ||
mod.rs | ||
persistent_buffer.rs | ||
persistent_buffer_impls.rs | ||
pipelines.rs | ||
remap_1d_to_2d_dispatch.wgsl | ||
resolve_render_targets.wgsl | ||
resource_manager.rs | ||
visibility_buffer_hardware_raster.wgsl | ||
visibility_buffer_raster_node.rs | ||
visibility_buffer_resolve.wgsl | ||
visibility_buffer_software_raster.wgsl |