Struct bevy_internal::render::view::ViewTarget
source · pub struct ViewTarget { /* private fields */ }
Implementations§
source§impl ViewTarget
impl ViewTarget
pub const TEXTURE_FORMAT_HDR: TextureFormat = TextureFormat::Rgba16Float
sourcepub fn get_color_attachment(&self) -> RenderPassColorAttachment<'_>
pub fn get_color_attachment(&self) -> RenderPassColorAttachment<'_>
Retrieve this target’s main texture’s color attachment.
sourcepub fn get_unsampled_color_attachment(&self) -> RenderPassColorAttachment<'_>
pub fn get_unsampled_color_attachment(&self) -> RenderPassColorAttachment<'_>
Retrieve this target’s “unsampled” main texture’s color attachment.
sourcepub fn main_texture(&self) -> &Texture
pub fn main_texture(&self) -> &Texture
The “main” unsampled texture.
sourcepub fn main_texture_other(&self) -> &Texture
pub fn main_texture_other(&self) -> &Texture
The other “main” unsampled texture.
In most cases you should use Self::main_texture
instead and never this.
The textures will naturally be swapped when Self::post_process_write
is called.
A use case for this is to be able to prepare a bind group for all main textures ahead of time.
sourcepub fn main_texture_view(&self) -> &TextureView
pub fn main_texture_view(&self) -> &TextureView
The “main” unsampled texture.
sourcepub fn main_texture_other_view(&self) -> &TextureView
pub fn main_texture_other_view(&self) -> &TextureView
The other “main” unsampled texture view.
In most cases you should use Self::main_texture_view
instead and never this.
The textures will naturally be swapped when Self::post_process_write
is called.
A use case for this is to be able to prepare a bind group for all main textures ahead of time.
sourcepub fn sampled_main_texture(&self) -> Option<&Texture>
pub fn sampled_main_texture(&self) -> Option<&Texture>
The “main” sampled texture.
sourcepub fn sampled_main_texture_view(&self) -> Option<&TextureView>
pub fn sampled_main_texture_view(&self) -> Option<&TextureView>
The “main” sampled texture view.
pub fn main_texture_format(&self) -> TextureFormat
sourcepub fn is_hdr(&self) -> bool
pub fn is_hdr(&self) -> bool
Returns true
if and only if the main texture is Self::TEXTURE_FORMAT_HDR
sourcepub fn out_texture(&self) -> &TextureView
pub fn out_texture(&self) -> &TextureView
The final texture this view will render to.
sourcepub fn out_texture_format(&self) -> TextureFormat
pub fn out_texture_format(&self) -> TextureFormat
The format of the final texture this view will render to
sourcepub fn post_process_write(&self) -> PostProcessWrite<'_>
pub fn post_process_write(&self) -> PostProcessWrite<'_>
This will start a new “post process write”, which assumes that the caller
will write the PostProcessWrite
’s source
to the destination
.
source
is the “current” main texture. This will internally flip this
ViewTarget
’s main texture to the destination
texture, so the caller
must ensure source
is copied to destination
, with or without modifications.
Failing to do so will cause the current main texture information to be lost.
Trait Implementations§
source§impl Component for ViewTarget
impl Component for ViewTarget
§type Storage = TableStorage
type Storage = TableStorage
TableStorage
or SparseStorage
.Auto Trait Implementations§
impl RefUnwindSafe for ViewTarget
impl Send for ViewTarget
impl Sync for ViewTarget
impl Unpin for ViewTarget
impl UnwindSafe for ViewTarget
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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
source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId) )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
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.