pub struct ExternalExtents { /* private fields */ }Expand description
The texel extent of every externally bound texture, keyed by the opaque id
a Command::SceneTexture names it by.
A projection of the renderer’s own registry, maintained by the one call that
owns both halves (EngineRenderer::bind_texture/unbind_texture), so the
two can never disagree about which ids are live. Only the extent crosses
over: the view stays on the GPU side, which is what keeps compile free of
wgpu.
A compiler built standalone starts empty, which reads as “nothing is bound”
— every SceneTexture then draws nothing, exactly as an unregistered id
does.
Implementations§
Source§impl ExternalExtents
impl ExternalExtents
Sourcepub fn bind(&mut self, id: u64, size: (u32, u32)) -> bool
pub fn bind(&mut self, id: u64, size: (u32, u32)) -> bool
Records id as bound at size texels, returning whether the extent is
usable at all.
A dimension past u16::MAX is refused rather than truncated: the record
the shader reads packs the source region into u16 halves, so a
truncated extent would sample a rectangle the caller never named. A
zero dimension is refused for the same reason a zero-sized image is —
there is no scale to map it onto dest with.