wgsl-types

Crates.iowgsl-types
lib.rswgsl-types
version0.0.4
sourcesrc
created_at2023-01-02 10:11:46.552979
updated_at2023-01-03 23:14:39.920854
descriptionWGSL Types
homepage
repositoryhttps://github.com/konkitoman/wgsl-types
max_upload_size
id749284
size24,211
Konkitoman (konkitoman)

documentation

README

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();
}
Commit count: 8

cargo fmt