4 releases

0.0.4 Jan 3, 2023
0.0.3 Jan 3, 2023
0.0.2 Jan 3, 2023
0.0.1 Jan 2, 2023

#747 in Graphics APIs

Download history 8/week @ 2024-02-24 1/week @ 2024-03-09 15/week @ 2024-03-30 1/week @ 2024-04-06 57/week @ 2024-04-20

73 downloads per month

GPL-3.0 license

25KB
860 lines

WGSL-TYPES

Crates.io

supports

  • vec2

  • vec3

  • vec4

is uses bytes-kman for serialization and deserialization

Example

use bytes_kman::prelude::*;
use wgsl_types::prelude::*;


fn main(){
    let a = vec3::<f32>(1.0, 1.0, 0.0);
    
    // this is the bytes!
    let mut bytes = a.to_bytes();
    // if you want to create a vec3 from bytes you need to have the bytes in reverse
    bytes.reverse();
    // the bytes will be consumed
    let b = <vec3::<f32>>::from_bytes(&mut bytes).unwrap();
}

Dependencies

~1.5MB
~35K SLoC