struct VertexState {
buffer: Arc<Buffer>,
range: Range<BufferAddress>,
is_dirty: bool,
}Expand description
The state of a single vertex buffer slot during render bundle encoding.
RenderBundleEncoder::finish uses this to drop redundant
SetVertexBuffer commands from the final RenderBundle. It
records one vertex buffer slot’s state changes here, and then
calls this type’s flush method just before any draw command to
produce a SetVertexBuffer commands if one is necessary.
Binding ranges must be validated against the size of the buffer before
being stored in VertexState.
Fields§
§buffer: Arc<Buffer>§range: Range<BufferAddress>§is_dirty: boolImplementations§
Source§impl VertexState
impl VertexState
Sourcefn new(buffer: Arc<Buffer>, range: Range<BufferAddress>) -> Self
fn new(buffer: Arc<Buffer>, range: Range<BufferAddress>) -> Self
Create a new VertexState.
The range must be contained within buffer.
Sourcefn flush(&mut self, slot: u32) -> Option<ArcRenderCommand>
fn flush(&mut self, slot: u32) -> Option<ArcRenderCommand>
Generate a SetVertexBuffer command for this slot, if necessary.
slot is the index of the vertex buffer slot that self tracks.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VertexState
impl !RefUnwindSafe for VertexState
impl Send for VertexState
impl Sync for VertexState
impl Unpin for VertexState
impl !UnwindSafe for VertexState
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