pub struct PassContext<'a> { /* private fields */ }Expand description
What a pass body is handed.
It has an encoder already inside the pass scope, the device (for the rare body that has to build something against a transient’s handle), and a way to turn a virtual id into the handle it landed on.
Implementations§
Source§impl PassContext<'_>
impl PassContext<'_>
Sourcepub fn encoder(&mut self) -> &mut dyn CommandEncoder
pub fn encoder(&mut self) -> &mut dyn CommandEncoder
The encoder, already inside this pass’s scope.
Sourcepub fn device(&self) -> &dyn Device
pub fn device(&self) -> &dyn Device
The device, for a body that must create something against a transient’s handle — a bind group naming a graph-owned image view, typically.
Sourcepub fn image_view(&self, id: ImageId) -> Handle<ImageView>
pub fn image_view(&self, id: ImageId) -> Handle<ImageView>
The view of a virtual image.
Stable frame to frame while the graph’s shape is, which is what lets a caller cache a bind group against it and rebuild only on a resize.
§Panics
If id came from a different graph.
Sourcepub const fn render_area(&self) -> Rect2d
pub const fn render_area(&self) -> Rect2d
The region this pass renders, in pixels. The viewport and scissor are already set to it.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PassContext<'a>
impl<'a> !UnwindSafe for PassContext<'a>
impl<'a> Forget for PassContext<'a>
impl<'a> Freeze for PassContext<'a>
impl<'a> Send for PassContext<'a>
impl<'a> Sync for PassContext<'a>
impl<'a> Unpin for PassContext<'a>
impl<'a> UnsafeUnpin for PassContext<'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
Mutably borrows from an owned value. Read more