Struct bevy::render::render_phase::TrackedRenderPass [−]
pub struct TrackedRenderPass<'a> { /* fields omitted */ }
Expand description
A [RenderPass
], which tracks the current pipeline state to ensure all draw calls are valid.
It is used to set the current RenderPipeline
, BindGroups
and buffers.
After all requirements are specified, draw calls can be issued.
Implementations
impl<'a> TrackedRenderPass<'a>
impl<'a> TrackedRenderPass<'a>
pub fn new(pass: RenderPass<'a>) -> TrackedRenderPass<'a>
pub fn new(pass: RenderPass<'a>) -> TrackedRenderPass<'a>
Tracks the supplied render pass.
pub fn set_render_pipeline(&mut self, pipeline: &'a RenderPipeline)
pub fn set_render_pipeline(&mut self, pipeline: &'a RenderPipeline)
Sets the active RenderPipeline
.
Subsequent draw calls will exhibit the behavior defined by the pipeline
.
Sets the active BindGroup
for a given bind group index. The bind group layout in the
active pipeline when any draw()
function is called must match the layout of this bind group
.
pub fn set_vertex_buffer(
&mut self,
slot_index: usize,
buffer_slice: BufferSlice<'a>
)
pub fn set_vertex_buffer(
&mut self,
slot_index: usize,
buffer_slice: BufferSlice<'a>
)
Assign a vertex buffer to a slot.
Subsequent calls to TrackedRenderPass::draw
and TrackedRenderPass::draw_indexed
will use the buffer referenced by buffer_slice
as one of the source vertex buffer(s).
The slot_index
refers to the index of the matching descriptor in
VertexState::buffers
.
pub fn set_index_buffer(
&mut self,
buffer_slice: BufferSlice<'a>,
offset: u64,
index_format: IndexFormat
)
pub fn set_index_buffer(
&mut self,
buffer_slice: BufferSlice<'a>,
offset: u64,
index_format: IndexFormat
)
Sets the active index buffer.
Subsequent calls to TrackedRenderPass::draw_indexed
will use the buffer referenced by
buffer_slice
as the source index buffer.
Draws primitives from the active vertex buffer(s).
The active vertex buffer(s) can be set with TrackedRenderPass::set_vertex_buffer
.
Draws indexed primitives using the active index buffer and the active vertex buffer(s).
The active index buffer can be set with TrackedRenderPass::set_index_buffer
, while the
active vertex buffer(s) can be set with TrackedRenderPass::set_vertex_buffer
.
pub fn set_stencil_reference(&mut self, reference: u32)
pub fn set_scissor_rect(&mut self, x: u32, y: u32, width: u32, height: u32)
pub fn set_scissor_rect(&mut self, x: u32, y: u32, width: u32, height: u32)
Sets the scissor region.
Subsequent draw calls will discard any fragments that fall outside this region.
pub fn set_push_constants(
&mut self,
stages: ShaderStages,
offset: u32,
data: &[u8]
)
pub fn set_push_constants(
&mut self,
stages: ShaderStages,
offset: u32,
data: &[u8]
)
Set push constant data.
Features::PUSH_CONSTANTS must be enabled on the device in order to call these functions.
Set the rendering viewport.
Subsequent draw calls will be projected into that viewport.
pub fn insert_debug_marker(&mut self, label: &str)
pub fn insert_debug_marker(&mut self, label: &str)
Insert a single debug marker.
This is a GPU debugging feature. This has no effect on the rendering itself.
pub fn push_debug_group(&mut self, label: &str)
pub fn push_debug_group(&mut self, label: &str)
Start a new debug group.
Push a new debug group over the internal stack. Subsequent render commands and debug
markers are grouped into this new group, until pop_debug_group
is called.
pass.push_debug_group("Render the car");
// [setup pipeline etc...]
pass.draw(0..64, 0..1);
pass.pop_debug_group();
Note that push_debug_group
and pop_debug_group
must always be called in pairs.
This is a GPU debugging feature. This has no effect on the rendering itself.
pub fn pop_debug_group(&mut self)
pub fn pop_debug_group(&mut self)
End the current debug group.
Subsequent render commands and debug markers are not grouped anymore in this group, but in the previous one (if any) or the default top-level one if the debug group was the last one on the stack.
Note that push_debug_group
and pop_debug_group
must always be called in pairs.
This is a GPU debugging feature. This has no effect on the rendering itself.
pub fn set_blend_constant(&mut self, color: Color)
Auto Trait Implementations
impl<'a> !RefUnwindSafe for TrackedRenderPass<'a>
impl<'a> Send for TrackedRenderPass<'a>
impl<'a> Sync for TrackedRenderPass<'a>
impl<'a> Unpin for TrackedRenderPass<'a>
impl<'a> !UnwindSafe for TrackedRenderPass<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
pub fn vzip(self) -> V
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more