bevy/crates/bevy_pbr/src
James Liu 1523c38ce8 Directly extract joints into SkinnedMeshJoints (#6833)
# Objective
Following #4402, extract systems run on the render world instead of the main world, and allow retained state operations on it's resources. We're currently extracting to `ExtractedJoints` and then copying it twice during Prepare. Once into `SkinnedMeshJoints` and again into the actual GPU buffer.

This makes #4902 obsolete.

## Solution
Cut out the middle copy and directly extract joints into `SkinnedMeshJoints` and remove `ExtractedJoints` entirely.

This also removes the per-frame allocation that is being made to send `ExtractedJoints` into the render world.

## Performance
On my local machine, this halves the time for `prepare_skinned _meshes` on `many_foxes` (195.75us -> 93.93us on average).

![image](https://user-images.githubusercontent.com/3137680/205427455-ab91a8a3-a6b0-4f0a-bd48-e54482c563b2.png)

---

## Changelog
Added: `BufferVec::truncate`
Added: `BufferVec::extend`
Changed: `SkinnedMeshJoints::build` now takes a `&mut BufferVec` instead of a `&mut Vec` as a parameter.
Removed: `ExtractedJoints`.

## Migration Guide
`ExtractedJoints` has been removed. Read the bound bones from `SkinnedMeshJoints` instead.
2022-12-20 16:17:05 +00:00
..
render Directly extract joints into SkinnedMeshJoints (#6833) 2022-12-20 16:17:05 +00:00
alpha.rs add ReflectAsset and ReflectHandle (#5923) 2022-10-28 20:42:33 +00:00
bundle.rs Visibilty Inheritance, universal ComputedVisibility and RenderLayers support (#5310) 2022-07-15 23:24:42 +00:00
lib.rs Add try_* to add_slot_edge, add_node_edge (#6720) 2022-11-21 21:58:39 +00:00
light.rs Reflect for Tonemapping and ClusterConfig (#6488) 2022-11-07 19:44:17 +00:00
material.rs Add DrawFunctionsInternals::id() (#6745) 2022-11-28 13:54:13 +00:00
pbr_material.rs Shader defs can now have a value (#5900) 2022-11-21 22:38:29 +00:00
wireframe.rs Add DrawFunctionsInternals::id() (#6745) 2022-11-28 13:54:13 +00:00