struct PassState<'a> {
pipeline: Option<&'a RenderPipeline>,
bind_groups: ArrayVec<(u32, &'a BindGroup), MAX_BIND_GROUPS>,
vertex_buffers: ArrayVec<(u32, &'a Buffer, Range<u64>), MAX_VERTEX_BUFFERS>,
index_buffer: Option<(&'a Buffer, Range<u64>, IndexFormat)>,
scissor: Option<ScissorRect>,
viewport: Option<ViewportRect>,
stencil_reference: u32,
}Expand description
Which resources the previous draw left bound.
The entries borrow from the draws being recorded, which outlive the
recording, so tracking them costs no clones. wgpu resources compare by
identity, so a plain == is the fast “is this the same resource as last
time” test the recording loop needs. The slots are fixed-capacity
(MAX_BIND_GROUPS / MAX_VERTEX_BUFFERS) so recording a frame never
allocates.
Fields§
§pipeline: Option<&'a RenderPipeline>§bind_groups: ArrayVec<(u32, &'a BindGroup), MAX_BIND_GROUPS>§vertex_buffers: ArrayVec<(u32, &'a Buffer, Range<u64>), MAX_VERTEX_BUFFERS>§index_buffer: Option<(&'a Buffer, Range<u64>, IndexFormat)>§scissor: Option<ScissorRect>§viewport: Option<ViewportRect>§stencil_reference: u32Implementations§
Source§impl<'a> PassState<'a>
impl<'a> PassState<'a>
fn set_bind_group( &mut self, pass: &mut impl RenderPassInterface<'a>, index: u32, bind_group: &'a BindGroup, )
Sourcefn set_vertex_buffer(
&mut self,
pass: &mut impl RenderPassInterface<'a>,
slot: u32,
buffer: &'a Buffer,
range: Range<u64>,
)
fn set_vertex_buffer( &mut self, pass: &mut impl RenderPassInterface<'a>, slot: u32, buffer: &'a Buffer, range: Range<u64>, )
Vertex-buffer slots are keyed by slot, and their value is the buffer and the byte range bound to it.
fn set_index_buffer( &mut self, pass: &mut impl RenderPassInterface<'a>, buffer: &'a Buffer, range: Range<u64>, format: IndexFormat, )
Sourcefn set_scissor(
&mut self,
pass: &mut impl RenderPassInterface<'a>,
scissor: ScissorRect,
)
fn set_scissor( &mut self, pass: &mut impl RenderPassInterface<'a>, scissor: ScissorRect, )
Narrow rasterization to scissor, skipping the call when the pass
already has that rectangle — a clip rectangle is usually shared by
many consecutive draws.
Sourcefn set_viewport(
&mut self,
pass: &mut impl RenderPassInterface<'a>,
viewport: ViewportRect,
)
fn set_viewport( &mut self, pass: &mut impl RenderPassInterface<'a>, viewport: ViewportRect, )
Set the viewport, skipping the call when the pass already holds that rectangle.
Sourcefn set_stencil_reference(
&mut self,
pass: &mut impl RenderPassInterface<'a>,
reference: u32,
)
fn set_stencil_reference( &mut self, pass: &mut impl RenderPassInterface<'a>, reference: u32, )
Set the stencil reference, skipping the call when the pass already holds it.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PassState<'a>
impl<'a> !UnwindSafe for PassState<'a>
impl<'a> Forget for PassState<'a>
impl<'a> Freeze for PassState<'a>
impl<'a> Send for PassState<'a>
impl<'a> Sync for PassState<'a>
impl<'a> Unpin for PassState<'a>
impl<'a> UnsafeUnpin for PassState<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more