pub struct FrameUniforms { /* private fields */ }Expand description
Per-frame uniform payloads — a typed map of engawa
ResourceId → bytemuck-encoded bytes that
WgpuDispatcher::dispatch_with writes into the
corresponding BoundResource::Uniform buffers before
any pass of that dispatch is encoded, so every node in the
graph walk sees the same frame data.
Entries are inserted through the typed FrameUniforms::set
/ FrameUniforms::with surface (bytemuck::Pod values
only) — there is no raw-bytes ingress, so a non-Pod or
padding-carrying struct cannot enter the map (compile error
at the bound, not a runtime check).
Implementations§
Source§impl FrameUniforms
impl FrameUniforms
pub fn new() -> Self
Sourcepub fn with<P: Pod>(self, id: impl Into<ResourceId>, params: &P) -> Self
pub fn with<P: Pod>(self, id: impl Into<ResourceId>, params: &P) -> Self
Builder-style insert of one Pod params value.
Sourcepub fn set<P: Pod>(&mut self, id: impl Into<ResourceId>, params: &P)
pub fn set<P: Pod>(&mut self, id: impl Into<ResourceId>, params: &P)
Insert (or replace) one Pod params value.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn iter(&self) -> impl Iterator<Item = (&ResourceId, &[u8])>
pub fn iter(&self) -> impl Iterator<Item = (&ResourceId, &[u8])>
Iterate entries in deterministic (BTreeMap) order.
Trait Implementations§
Source§impl Clone for FrameUniforms
impl Clone for FrameUniforms
Source§fn clone(&self) -> FrameUniforms
fn clone(&self) -> FrameUniforms
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for FrameUniforms
impl Default for FrameUniforms
Source§fn default() -> FrameUniforms
fn default() -> FrameUniforms
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FrameUniforms
impl RefUnwindSafe for FrameUniforms
impl Send for FrameUniforms
impl Sync for FrameUniforms
impl Unpin for FrameUniforms
impl UnsafeUnpin for FrameUniforms
impl UnwindSafe for FrameUniforms
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