Crates.io | serde_webgpu |
lib.rs | serde_webgpu |
version | 0.2.1 |
source | src |
created_at | 2023-06-03 09:17:06.386708 |
updated_at | 2023-10-25 00:35:34.088417 |
description | Serialize WebGPU uniform buffer member layout |
homepage | |
repository | https://github.com/823984418/serde_webgpu |
max_upload_size | |
id | 881497 |
size | 23,446 |
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();