pub struct AosLayout { /* private fields */ }Expand description
MaterialLayout implementation that packs each material into a single
contiguous byte blob (array-of-structs) via pack(), grouping materials
by their packed size into separate buckets - materials using different
strategies with different field sets don’t have to share a stride.
Holds plain bytes in memory; turning those bytes into an actual GPU buffer (e.g. a Vulkan SSBO) is the caller’s responsibility.
Implementations§
Source§impl AosLayout
impl AosLayout
pub fn new() -> Self
Sourcepub fn bucket_bytes(&self, stride: usize) -> Option<&[u8]>
pub fn bucket_bytes(&self, stride: usize) -> Option<&[u8]>
Raw bytes currently stored for the bucket at stride, if any
material has been uploaded at that size yet.
Trait Implementations§
Source§impl MaterialLayout for AosLayout
impl MaterialLayout for AosLayout
Source§fn register_strategy(&mut self, strategy: &dyn ShadingStrategy)
fn register_strategy(&mut self, strategy: &dyn ShadingStrategy)
Prepares this layout to store values for
strategy’s fields. Called
once per strategy, before any upload for a material using it.Source§fn upload(
&mut self,
handle: MaterialHandle,
strategy: &dyn ShadingStrategy,
values: &[MaterialValue],
)
fn upload( &mut self, handle: MaterialHandle, strategy: &dyn ShadingStrategy, values: &[MaterialValue], )
Writes
values (as resolved by strategy.resolve(), in
strategy.fields() order) into this layout’s storage for handle.Auto Trait Implementations§
impl Freeze for AosLayout
impl RefUnwindSafe for AosLayout
impl Send for AosLayout
impl Sync for AosLayout
impl Unpin for AosLayout
impl UnsafeUnpin for AosLayout
impl UnwindSafe for AosLayout
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
Mutably borrows from an owned value. Read more