Expand description
Off-screen render targets for cached widget subtrees and compositing.
RenderTarget owns an offscreen Rgba8Unorm texture that can be used as
a RENDER_ATTACHMENT, and whose contents can be read back to CPU memory or
sampled as a texture in subsequent render passes.
§Usage
- Create a
RenderTargetwithRenderTarget::new. - Render into it by using
RenderTarget::color_viewas the colour attachment in a render pass. - Optionally call
RenderTarget::readback_rgbafor CPU pixel access. - Use
RenderTarget::texture_view+ a sampler to composite the target into a parent pass (e.g. via the textured pipeline).
Render targets support optional MSAA: pass sample_count > 1 to obtain a
multisample render texture that resolves into the single-sample backing
texture on each render pass. The backing texture (color_texture) is
always sample_count=1 and COPY_SRC, making readback straightforward.
Structs§
- Render
Target - An off-screen GPU render target.