[−][src]Struct vulkano::command_buffer::StateCacher
Keep track of the state of a command buffer builder, so that you don't need to bind objects that were already bound.
Important: Executing a secondary command buffer invalidates the state of a command buffer builder. When you do so, you need to call
invalidate()
.
Implementations
impl StateCacher
[src]
pub fn new() -> StateCacher
[src]
Builds a new StateCacher
.
pub fn invalidate(&mut self)
[src]
Resets the cache to its default state. You must call this after executing a secondary command buffer.
pub fn dynamic_state(&mut self, incoming: &DynamicState) -> DynamicState
[src]
Compares the current state with incoming
, and returns a new state that contains the
states that differ and that need to be actually set in the command buffer builder.
This function also updates the state cacher. The state cacher assumes that the state changes are going to be performed after this function returns.
pub fn bind_descriptor_sets(
&mut self,
graphics: bool
) -> StateCacherDescriptorSets<'_>
[src]
&mut self,
graphics: bool
) -> StateCacherDescriptorSets<'_>
Starts the process of comparing a list of descriptor sets to the descriptor sets currently in cache.
After calling this function, call add
for each set one by one. Then call compare
in
order to get the index of the first set to bind, or None
if the sets were identical to
what is in cache.
This process also updates the state cacher. The state cacher assumes that the state
changes are going to be performed after the compare
function returns.
pub fn bind_graphics_pipeline<P>(&mut self, pipeline: &P) -> StateCacherOutcome where
P: GraphicsPipelineAbstract,
[src]
P: GraphicsPipelineAbstract,
Checks whether we need to bind a graphics pipeline. Returns StateCacherOutcome::AlreadyOk
if the pipeline was already bound earlier, and StateCacherOutcome::NeedChange
if you need
to actually bind the pipeline.
This function also updates the state cacher. The state cacher assumes that the state changes are going to be performed after this function returns.
pub fn bind_compute_pipeline<P>(&mut self, pipeline: &P) -> StateCacherOutcome where
P: ComputePipelineAbstract,
[src]
P: ComputePipelineAbstract,
Checks whether we need to bind a compute pipeline. Returns StateCacherOutcome::AlreadyOk
if the pipeline was already bound earlier, and StateCacherOutcome::NeedChange
if you need
to actually bind the pipeline.
This function also updates the state cacher. The state cacher assumes that the state changes are going to be performed after this function returns.
pub fn bind_vertex_buffers(&mut self) -> StateCacherVertexBuffers<'_>
[src]
Starts the process of comparing a list of vertex buffers to the vertex buffers currently in cache.
After calling this function, call add
for each set one by one. Then call compare
in
order to get the range of the vertex buffers to bind, or None
if the sets were identical
to what is in cache.
This process also updates the state cacher. The state cacher assumes that the state
changes are going to be performed after the compare
function returns.
pub fn bind_index_buffer<B: ?Sized>(
&mut self,
index_buffer: &B,
ty: IndexType
) -> StateCacherOutcome where
B: BufferAccess,
[src]
&mut self,
index_buffer: &B,
ty: IndexType
) -> StateCacherOutcome where
B: BufferAccess,
Checks whether we need to bind an index buffer. Returns StateCacherOutcome::AlreadyOk
if the index buffer was already bound earlier, and StateCacherOutcome::NeedChange
if you
need to actually bind the buffer.
This function also updates the state cacher. The state cacher assumes that the state changes are going to be performed after this function returns.
Auto Trait Implementations
impl RefUnwindSafe for StateCacher
impl Send for StateCacher
impl Sync for StateCacher
impl Unpin for StateCacher
impl UnwindSafe for StateCacher
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Content for T
[src]
fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
fn is_size_suitable(usize) -> bool
[src]
fn indiv_size() -> usize
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,