pub struct TextureBlitter { /* private fields */ }Available on crate feature
wgsl only.Expand description
Texture Blitting (Copying) Utility
Use this if you want to just render/copy texture A to texture B where CommandEncoder::copy_texture_to_texture would not work because:
- Textures are in incompatible formats.
- Textures are of different sizes.
- Your copy destination is the surface texture and does not have the
COPY_DSTusage.
Implementations§
Source§impl TextureBlitter
impl TextureBlitter
Sourcepub fn new(device: &Device, format: TextureFormat) -> Self
pub fn new(device: &Device, format: TextureFormat) -> Self
Returns a TextureBlitter with default settings.
§Arguments
device- ADeviceformat- TheTextureFormatof the texture that will be copied to. This has to have theRENDER_TARGETusage.
Properties of the blitting (such as the BlendState) can be customised by using TextureBlitterBuilder instead.
Sourcepub fn copy(
&self,
device: &Device,
encoder: &mut CommandEncoder,
source: &TextureView,
target: &TextureView,
)
pub fn copy( &self, device: &Device, encoder: &mut CommandEncoder, source: &TextureView, target: &TextureView, )
Copies the data from the source TextureView to the target TextureView
§Arguments
device- ADeviceencoder- ACommandEncodersource- ATextureViewthat gets copied. The format does not matter.target- ATextureViewthat gets the data copied from thesource. It has to be the same format as the format specified inTextureBlitter::new
Auto Trait Implementations§
impl !RefUnwindSafe for TextureBlitter
impl !UnwindSafe for TextureBlitter
impl Forget for TextureBlitter
impl Freeze for TextureBlitterwhere
*const ArcInner<CoreRenderPipeline> is !null: Freeze,
PhantomData<ArcInner<CoreRenderPipeline>>: Freeze,
*const ArcInner<dyn RenderPipelineInterface> is !null: Freeze,
PhantomData<ArcInner<dyn RenderPipelineInterface>>: Freeze,
*const ArcInner<CoreBindGroupLayout> is !null: Freeze,
PhantomData<ArcInner<CoreBindGroupLayout>>: Freeze,
*const ArcInner<dyn BindGroupLayoutInterface> is !null: Freeze,
PhantomData<ArcInner<dyn BindGroupLayoutInterface>>: Freeze,
*const ArcInner<CoreSampler> is !null: Freeze,
PhantomData<ArcInner<CoreSampler>>: Freeze,
*const ArcInner<dyn SamplerInterface> is !null: Freeze,
PhantomData<ArcInner<dyn SamplerInterface>>: Freeze,
impl Move for TextureBlitter
impl Send for TextureBlitterwhere
Arc<CoreRenderPipeline>: Send,
Arc<dyn RenderPipelineInterface>: Send,
Arc<CoreBindGroupLayout>: Send,
Arc<dyn BindGroupLayoutInterface>: Send,
Arc<CoreSampler>: Send,
Arc<dyn SamplerInterface>: Send,
impl Sync for TextureBlitterwhere
Arc<CoreRenderPipeline>: Sync,
Arc<dyn RenderPipelineInterface>: Sync,
Arc<CoreBindGroupLayout>: Sync,
Arc<dyn BindGroupLayoutInterface>: Sync,
Arc<CoreSampler>: Sync,
Arc<dyn SamplerInterface>: Sync,
impl Unpin for TextureBlitterwhere
Arc<CoreRenderPipeline>: Unpin,
Arc<dyn RenderPipelineInterface>: Unpin,
Arc<CoreBindGroupLayout>: Unpin,
Arc<dyn BindGroupLayoutInterface>: Unpin,
Arc<CoreSampler>: Unpin,
Arc<dyn SamplerInterface>: Unpin,
impl UnsafeUnpin for TextureBlitterwhere
*const ArcInner<CoreRenderPipeline> is !null: UnsafeUnpin,
PhantomData<ArcInner<CoreRenderPipeline>>: UnsafeUnpin,
*const ArcInner<dyn RenderPipelineInterface> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn RenderPipelineInterface>>: UnsafeUnpin,
*const ArcInner<CoreBindGroupLayout> is !null: UnsafeUnpin,
PhantomData<ArcInner<CoreBindGroupLayout>>: UnsafeUnpin,
*const ArcInner<dyn BindGroupLayoutInterface> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn BindGroupLayoutInterface>>: UnsafeUnpin,
*const ArcInner<CoreSampler> is !null: UnsafeUnpin,
PhantomData<ArcInner<CoreSampler>>: UnsafeUnpin,
*const ArcInner<dyn SamplerInterface> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn SamplerInterface>>: UnsafeUnpin,
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