MCPcopy Create free account
hub / github.com/evilsocket/cake / write_f32

Method write_f32

cake-core/src/backends/vulkan/mod.rs:44–50  ·  view source on GitHub ↗

Write f32 data into the buffer via mapped pointer.

(&self, data: &[f32])

Source from the content-addressed store, hash-verified

42impl MappedBuffer {
43 /// Write f32 data into the buffer via mapped pointer.
44 fn write_f32(&self, data: &[f32]) {
45 let bytes = bytemuck::cast_slice::<f32, u8>(data);
46 assert!(bytes.len() as u64 <= self.size);
47 unsafe {
48 std::ptr::copy_nonoverlapping(bytes.as_ptr(), self.mapped_ptr, bytes.len());
49 }
50 }
51
52 /// Read f32 data from the buffer via mapped pointer.
53 fn read_f32(&self, count: usize) -> Vec<f32> {

Callers 2

get_or_uploadMethod · 0.80
upload_uncachedMethod · 0.80

Calls 1

as_ptrMethod · 0.80

Tested by

no test coverage detected