Skip to main content

Module external

Module external 

Source
Expand description

Lowering for Command::SceneTexture: a caller-owned GPU texture drawn over a destination rectangle.

The command is the scene layer’s one reference to a texture the engine did not produce. It carries an opaque u64 and a destination rectangle and nothing else — no pixels, no extent, no sampler — because the scene layer depends on no GPU crate (see frust_scene::Command::SceneTexture). So the two halves of the lowering sit on opposite sides of the frame:

  1. the extent is registry state, learned when the host registers the texture and kept here in ExternalExtents so the walk can compose the same natural-pixels-onto-dest mapping [Command::Image] uses; and
  2. the view is the renderer’s, resolved after compiling against the same registry (see crate::gpu::bindings).

The split is what keeps this module free of wgpu, like the rest of compile. It is also why an unregistered id is decided here rather than at encode time: with no extent there is no mapping to compose, so the draw never reaches the frame’s paint table at all.

Unlike an atlas-backed image, nothing is made resident and nothing is uploaded — the texels are the caller’s, already on the device. The encoded entry is therefore a plain EncodedExternalTexture naming the id, the source region and the inverse device-to-texel transform the shader applies.

Structs§

ExternalEncoding
One encoded external-texture paint: the paint a draw references, and where its entry landed in the frame’s paint table.
ExternalExtents
The texel extent of every externally bound texture, keyed by the opaque id a Command::SceneTexture names it by.

Enums§

ExternalSkip
Why a Command::SceneTexture recorded no draw.

Functions§

encode_scene_texture
Encode a Command::SceneTexture: the whole of the texture bound under id scaled to fill dest, under transform.