Crevice
Crevice creates GLSL-compatible versions of types through the power of derive macros. Generated structs implement a number of traits from other crates:
bytemuck::Zeroable
andbytemuck::Pod
to ease packing data into buffers for uploading.type_layout::TypeLayout
to debug the layout generated by the crate.
Crevice is similar to glsl-layout
, but supports mint
types
and explicitly initializes padding to remove one source of undefined behavior.
Examples
This example uses cgmath
, but any math crate that works with the mint
crate
also works.
use AsStd140;
use *;
use ;
let value = MainUniform ;
let value_std140 = value.as_std140;
upload_data_to_gpu;
Minimum Supported Rust Version (MSRV)
Crevice supports Rust 1.46.0 and newer due to use of new const fn
features.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.