Skip to main content

register_external_pass

Function register_external_pass 

Source
pub fn register_external_pass(
    id: SceneTextureId,
    pass: Arc<dyn ExternalPass>,
) -> bool
Expand description

Registers pass under id, to be recorded every frame until unregister_external_pass takes it back.

Answers false and changes nothing when id already has a pass: a registration is a claim on an id, and silently displacing another component’s pass would leave it registered from its own point of view and never called. Unregister first to hand an id over deliberately.

Also answers false and changes nothing when id is inside the reserved shader-program namespace (SceneTextureId::is_shader_program) — that range belongs to the engine’s own offscreen shader-effect targets, and a caller-registered pass claiming one would silently steal a shader program’s target out from under it. Reported at warn! the first time a given id is refused this way, debug! on every later attempt, so a caller retrying the same doomed registration every frame does not spam the log.

A register landing before the drain has flushed the same id’s queued unbind cancels that unbind: the id has an owner again. A successful registration also clears any panic already reported for id, so a fresh pass’s first panic is reported fresh rather than silently downgraded by a predecessor’s history.