MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / flush_joint_matrices

Method flush_joint_matrices

native/shared/src/renderer/mod.rs:12398–12415  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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

Callers 2

end_frameMethod · 0.80
end_frame_with_sceneMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected