serde_webgpu

Crates.ioserde_webgpu
lib.rsserde_webgpu
version0.2.1
sourcesrc
created_at2023-06-03 09:17:06.386708
updated_at2023-10-25 00:35:34.088417
descriptionSerialize WebGPU uniform buffer member layout
homepage
repositoryhttps://github.com/823984418/serde_webgpu
max_upload_size
id881497
size23,446
(823984418)

documentation

README

serde_webgpu

Serialize content to WebGPU.

#[derive(Serialize)]
struct Uniform {
    a: f16,
    b: mat4x4<f32>,
}

let uniform = Uniform {
    a: f16::from_f32(123.456),
    b: [
        vec4([1.0, 2.0, 3.0, 4.0]),
        vec4([4.0, 5.0, 7.0, 8.0]),
        vec4([1.0, 2.0, 3.0, 4.0]),
        vec4([5.0, 6.0, 7.0, 8.0]),
    ],
};

serialize_webgpu_buffer(&uniform).unwrap();
Commit count: 8

cargo fmt