pub struct CopyPresentPass { /* private fields */ }Expand description
The plain present pass for one surface: the frame, rendered into an intermediate of the swapchain’s own format, copied into the swapchain unconverted (see the module doc’s A plain copy).
Built once per surface configure, like UnpremultiplyPass: a pipeline
for the swapchain’s format, the bind-group layout its program derived, and
the one 16-byte instance the quad is drawn from.
Implementations§
Source§impl CopyPresentPass
impl CopyPresentPass
Sourcepub fn new(
device: &Device,
format: TextureFormat,
driver_cache: Option<&PipelineCache>,
) -> Self
pub fn new( device: &Device, format: TextureFormat, driver_cache: Option<&PipelineCache>, ) -> Self
Builds the pass for a format target, through a pipeline cache of its
own exactly as UnpremultiplyPass::new does — a surface configure is
not a frame, so the one pipeline is compiled here.
Sourcepub fn format(&self) -> TextureFormat
pub fn format(&self) -> TextureFormat
The target format this pass was built for — the swapchain’s own.
Sourcepub fn record(
&self,
device: &Device,
queue: &Queue,
encoder: &mut CommandEncoder,
source_view: &TextureView,
target_view: &TextureView,
size: (u32, u32),
timestamp_writes: Option<RenderPassTimestampWrites<'_>>,
)
pub fn record( &self, device: &Device, queue: &Queue, encoder: &mut CommandEncoder, source_view: &TextureView, target_view: &TextureView, size: (u32, u32), timestamp_writes: Option<RenderPassTimestampWrites<'_>>, )
Records the copy into encoder: reads source_view (the intermediate
the frame was rendered into, width x height like the swapchain) and
writes it unconverted over the whole of target_view (the acquired
swapchain texture). The caller submits encoder.
The instance is written through queue and lands ahead of the command
buffer the caller submits, so a resize between frames is honoured by
the very next one. The attachment is cleared rather than loaded, for
UnpremultiplyPass::record’s reason. timestamp_writes is that
method’s too.
Sourcepub fn layout_desc() -> PipelineLayoutDesc
pub fn layout_desc() -> PipelineLayoutDesc
This pass’s shape as the downlevel lint reads it — one bind group, one
instance buffer of four u32 attributes, no uniform.