(&mut self)
| 12396 | } |
| 12397 | |
| 12398 | fn flush_joint_matrices(&mut self) { |
| 12399 | // Accumulator = all skinned poses staged by skinned drawModel |
| 12400 | // calls this frame, packed consecutively. Each draw's vertex |
| 12401 | // joint indices were pre-offset at submit time, so a single |
| 12402 | // flat upload here is all the GPU needs. |
| 12403 | const MAX_JOINT_SLOTS: usize = 1024; |
| 12404 | let count = self.frame_joint_data.len().min(MAX_JOINT_SLOTS); |
| 12405 | if count > 0 { |
| 12406 | let mut all_data = vec![[[0.0f32; 4]; 4]; MAX_JOINT_SLOTS]; |
| 12407 | for i in 0..count { |
| 12408 | all_data[i] = self.frame_joint_data[i]; |
| 12409 | } |
| 12410 | self.queue.write_buffer(&self.joint_buffer, 0, bytemuck::cast_slice(&all_data)); |
| 12411 | } |
| 12412 | self.frame_joint_data.clear(); |
| 12413 | // Any leftover staged poses are stale (no draw consumed them). |
| 12414 | self.pending_skin_groups.clear(); |
| 12415 | } |
| 12416 | |
| 12417 | // ============================================================ |
| 12418 | // 3D texture tracking |
no test coverage detected