mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
f9cc91d5a1
Although we cached hashes of `MeshVertexBufferLayout`, we were paying the cost of `PartialEq` on `InnerMeshVertexBufferLayout` for every entity, every frame. This patch changes that logic to place `MeshVertexBufferLayout`s in `Arc`s so that they can be compared and hashed by pointer. This results in a 28% speedup in the `queue_material_meshes` phase of `many_cubes`, with frustum culling disabled. Additionally, this patch contains two minor changes: 1. This commit flattens the specialized mesh pipeline cache to one level of hash tables instead of two. This saves a hash lookup. 2. The example `many_cubes` has been given a `--no-frustum-culling` flag, to aid in benchmarking. See the Tracy profile: <img width="1064" alt="Screenshot 2024-02-29 144406" src="https://github.com/bevyengine/bevy/assets/157897/18632f1d-1fdd-4ac7-90ed-2d10306b2a1e"> ## Migration guide * Duplicate `MeshVertexBufferLayout`s are now combined into a single object, `MeshVertexBufferLayoutRef`, which contains an atomically-reference-counted pointer to the layout. Code that was using `MeshVertexBufferLayout` may need to be updated to use `MeshVertexBufferLayoutRef` instead. |
||
---|---|---|
.. | ||
animate_shader.rs | ||
array_texture.rs | ||
compute_shader_game_of_life.rs | ||
custom_vertex_attribute.rs | ||
extended_material.rs | ||
fallback_image.rs | ||
post_processing.rs | ||
shader_defs.rs | ||
shader_instancing.rs | ||
shader_material.rs | ||
shader_material_2d.rs | ||
shader_material_glsl.rs | ||
shader_material_screenspace_texture.rs | ||
shader_prepass.rs | ||
texture_binding_array.rs |