Skip to main content

Module headless

Module headless 

Source
Expand description

An offscreen render target with no swapchain and no wgpu::Surface: HeadlessTarget, for tests and tooling that need to render through this crate’s own seams (crate::encoder::CommandBuffer) with no window.

HeadlessTarget requests RENDER_ATTACHMENT | COPY_SRC and deliberately not STORAGE_BINDING — this crate renders through ordinary render passes, not compute, so a downlevel (WebGL2/GLES3.0) target never needs a usage flag that profile does not offer. HeadlessTarget::read_back strips wgpu’s mandatory copy_texture_to_buffer row padding so an arbitrary width — not just one whose row happens to already be aligned — reads back exactly; the padding/stripping arithmetic here is written to be liftable into a shared helper once frust-render’s own headless module needs the identical calculation.

Structs§

HeadlessTarget
An offscreen render target: one wgpu::Texture plus its full-extent view, created with RENDER_ATTACHMENT | COPY_SRC usage and no STORAGE_BINDING.