bevy/crates/bevy_pbr/src/render
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
..
clustered_forward.wgsl Shader defs can now have a value (#5900) 2022-11-21 22:38:29 +00:00
depth.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
light.rs ShaderDefVal: add an UInt option (#6881) 2022-12-07 23:10:27 +00:00
mesh.rs Directly extract joints into SkinnedMeshJoints (#6833) 2022-12-20 16:17:05 +00:00
mesh.wgsl bevy_pbr: Fix incorrect and unnecessary normal-mapping code (#5766) 2022-11-03 20:37:32 +00:00
mesh_bindings.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
mesh_functions.wgsl bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 21:54:40 +00:00
mesh_types.wgsl bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 21:54:40 +00:00
mesh_vertex_output.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
mesh_view_bindings.wgsl Shader defs can now have a value (#5900) 2022-11-21 22:38:29 +00:00
mesh_view_types.wgsl Shader defs can now have a value (#5900) 2022-11-21 22:38:29 +00:00
mod.rs Materials and MaterialPlugin (#3428) 2021-12-25 21:45:43 +00:00
pbr.wgsl Fix missing sRGB conversion for dithering non-HDR pipelines (#6707) 2022-11-22 15:55:50 +00:00
pbr_bindings.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
pbr_functions.wgsl Fix color banding by dithering image before quantization (#5264) 2022-11-11 19:43:45 +00:00
pbr_lighting.wgsl separate tonemapping and upscaling passes (#3425) 2022-10-26 20:13:59 +00:00
pbr_types.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
shadows.wgsl Spotlights (#4715) 2022-07-08 19:57:43 +00:00
skinning.wgsl bevy_pbr: Normalize skinned normals (#6543) 2022-11-11 03:31:57 +00:00
utils.wgsl Use wgsl saturate (#6318) 2022-10-22 08:37:51 +00:00
wireframe.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00