Skip to main content

Module bindings

Module bindings 

Source
Expand description

The registry of caller-owned textures a frame’s strip passes sample, and the per-frame batching that binds each of them in turn.

The engine draws two kinds of image. An atlas-backed one lives in the renderer’s own array texture, addressed by layer and rectangle, and every draw of the frame reads it through the same binding. An external one is a texture the host created and still owns — a video frame, a plugin’s import, an offscreen page some other pass rendered — which the engine never copies and never packs. It is bound as a whole texture instead, and the strip shader’s image path reads it through a second binding chosen by the encoded paint’s source-kind bit (see shaders/helpers.wgsl).

One binding, many textures: a frame that draws two different external textures cannot bind both at once, so its instances are split into runs — maximal spans of consecutive instances sharing one texture — and each run is drawn with that texture bound. ExternalRuns assigns the slot numbers the renderer’s pass segments name a run by; the renderer builds one group-1 bind group per slot and sets it between runs.

Nothing here allocates a texture or copies a texel. ExternalTextures is a plain map the host writes through EngineRenderer::bind_texture/unbind_texture, and it is generic over the stored view type — like frust_gpu::TextureRegistry, so its own behaviour stays host-testable with a stand-in value and no GPU device in the loop.

The extent half of the same registry lives on the compiler side, in crate::compile::external::ExternalExtents: the walk needs it to compose a paint transform, while only a pass needs the view. The one call that writes both keeps them in step.

Structs§

ExternalRuns
The distinct external textures one frame draws with, in the order it first names them.
ExternalTextures
Every externally owned texture currently bound, keyed by the SceneTextureId its owner minted.

Functions§

lower_encoded_external
Lower one encoded external texture into the record the strip shader samples.