Commit 1508554
committed
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).

---
## 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.1 parent f8e4b75 commit 1508554
File tree
2 files changed
+32
-31
lines changed- crates
- bevy_pbr/src/render
- bevy_render/src/render_resource
2 files changed
+32
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 175 | | |
181 | 176 | | |
182 | 177 | | |
| |||
188 | 183 | | |
189 | 184 | | |
190 | 185 | | |
191 | | - | |
| 186 | + | |
192 | 187 | | |
193 | 188 | | |
194 | | - | |
195 | | - | |
196 | 189 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
204 | 202 | | |
205 | 203 | | |
206 | 204 | | |
| |||
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
224 | | - | |
| 222 | + | |
225 | 223 | | |
226 | 224 | | |
227 | 225 | | |
228 | 226 | | |
| 227 | + | |
229 | 228 | | |
230 | | - | |
231 | 229 | | |
232 | 230 | | |
233 | 231 | | |
| |||
236 | 234 | | |
237 | 235 | | |
238 | 236 | | |
239 | | - | |
| 237 | + | |
240 | 238 | | |
241 | 239 | | |
242 | 240 | | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
246 | 244 | | |
247 | | - | |
248 | | - | |
| 245 | + | |
| 246 | + | |
249 | 247 | | |
250 | 248 | | |
251 | 249 | | |
252 | | - | |
253 | | - | |
254 | 250 | | |
255 | 251 | | |
256 | 252 | | |
| |||
779 | 775 | | |
780 | 776 | | |
781 | 777 | | |
782 | | - | |
783 | 778 | | |
784 | 779 | | |
785 | | - | |
| 780 | + | |
786 | 781 | | |
787 | 782 | | |
788 | 783 | | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
| 784 | + | |
| 785 | + | |
796 | 786 | | |
797 | 787 | | |
798 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
0 commit comments