pub struct PostPass<'a> {
pub device: &'a Device,
pub queue: &'a Queue,
pub encoder: &'a mut CommandEncoder,
pub input: &'a TextureView,
pub output: &'a TextureView,
pub history: Option<&'a TextureView>,
pub indices: Option<&'a TextureView>,
pub format: TextureFormat,
pub stage: PostStage,
pub size: [u32; 2],
pub globals: PostGlobals,
/* private fields */
}Expand description
Everything a PostEffect gets for one run.
Fields§
§device: &'a Device§queue: &'a Queue§encoder: &'a mut CommandEncoder§input: &'a TextureViewThe image so far: the scene, or the previous effect’s output.
output: &'a TextureViewWhere to write; the same size and format as input.
history: Option<&'a TextureView>The stage’s final output from the previous frame, when an effect of the stage asked
for it via PostEffect::uses_history; black on the first frame and after a resize.
indices: Option<&'a TextureView>With indexed colour on (feature indexed), the canvas’s palette indices before the
palette lookup and cycling, at the canvas size (also in the
Window stage, where input is window-sized; map positions with
PostGlobals::canvas_origin and canvas_extent). Read them with index_in from
INDEX_WGSL (feature indexed), e.g. to make only some palette entries glow. None
without indexed colour.
format: TextureFormat§stage: PostStage§size: [u32; 2]Width and height of input and output.
globals: PostGlobalsImplementations§
Source§impl<'a> PostPass<'a>
impl<'a> PostPass<'a>
Sourcepub fn texture(&self, id: TextureId) -> Option<&'a TextureView>
pub fn texture(&self, id: TextureId) -> Option<&'a TextureView>
The view of a painter texture (from create_texture_rgba, load_texture,
register_texture, …), for effects that read a source of the game’s own besides the
scene: a video frame or emulated screen uploaded each frame with
update_texture_rgba, a lookup table. Looked up on every run, so it follows hot
reloads. None for an unknown id.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PostPass<'a>
impl<'a> !UnwindSafe for PostPass<'a>
impl<'a> Forget for PostPass<'a>
impl<'a> Freeze for PostPass<'a>
impl<'a> Send for PostPass<'a>
impl<'a> Sync for PostPass<'a>
impl<'a> Unpin for PostPass<'a>
impl<'a> UnsafeUnpin for PostPass<'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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.