Struct wgsl_to_wgpu::WriteOptions
source · pub struct WriteOptions {
pub derive_bytemuck_vertex: bool,
pub derive_bytemuck_host_shareable: bool,
pub derive_encase_host_shareable: bool,
pub derive_serde: bool,
pub matrix_vector_types: MatrixVectorTypes,
}
Expand description
Options for configuring the generated bindings to work with additional dependencies. Use WriteOptions::default for only requiring WGPU itself.
Fields§
§derive_bytemuck_vertex: bool
Derive bytemuck::Pod
and bytemuck::Zeroable
for WGSL vertex input structs when true
.
Derive bytemuck::Pod
and bytemuck::Zeroable
for user defined WGSL structs for host-shareable types (uniform and storage buffers) when true
.
This will generate compile time assertions to check that the memory layout of structs and struct fields matches what is expected by WGSL. This does not account for all layout and alignment rules like storage buffer offset alignment.
Most applications should instead handle these requirements more reliably at runtime using encase.
Derive encase::ShaderType
for user defined WGSL structs for host-shareable types (uniform and storage buffers) when true
.
Use MatrixVectorTypes::Glam for best compatibility.
derive_serde: bool
Derive serde::Serialize
and serde::Deserialize
for user defined WGSL structs when true
.
matrix_vector_types: MatrixVectorTypes
The format to use for matrix and vector types.
Trait Implementations§
source§impl Clone for WriteOptions
impl Clone for WriteOptions
source§fn clone(&self) -> WriteOptions
fn clone(&self) -> WriteOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WriteOptions
impl Debug for WriteOptions
source§impl Default for WriteOptions
impl Default for WriteOptions
source§fn default() -> WriteOptions
fn default() -> WriteOptions
source§impl PartialEq for WriteOptions
impl PartialEq for WriteOptions
source§fn eq(&self, other: &WriteOptions) -> bool
fn eq(&self, other: &WriteOptions) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for WriteOptions
impl Eq for WriteOptions
impl StructuralPartialEq for WriteOptions
Auto Trait Implementations§
impl Freeze for WriteOptions
impl RefUnwindSafe for WriteOptions
impl Send for WriteOptions
impl Sync for WriteOptions
impl Unpin for WriteOptions
impl UnwindSafe for WriteOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.