Skip to main content

PassContext

Struct PassContext 

Source
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<'_>

Source

pub fn encoder(&mut self) -> &mut dyn CommandEncoder

The encoder, already inside this pass’s scope.

Source

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.

Source

pub fn image(&self, id: ImageId) -> Handle<Image>

The handle a virtual image landed on.

§Panics

If id came from a different graph.

Source

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.

Source

pub fn buffer(&self, id: BufferId) -> Handle<Buffer>

The handle a virtual buffer landed on.

§Panics

If id came from a different graph.

Source

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§

Source§

impl<'a> Debug for PassContext<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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> Move 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HalThreadSafe for T
where T: Send + Sync,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.