Interface DrawBinding
pipeline: GPURenderPipeline;
renderable: Renderable;
draw(
pass: GPURenderPassEncoder | GPURenderBundleEncoder,
engine: EngineContext,
): number;
update?(context: DrawUpdateContext): void;
}
Properties
Readonlypipeline
Pipeline used by this binding. The render pass task owns setPipeline() and dedups consecutive bindings with the same pipeline.
Readonlyrenderable
Back-reference for sort/eviction (order, mesh identity).
Methods
draw
-
Issue draw commands for this renderable into
pass. The render pass task has already set the scene bind group (group 0) andpass.setPipeline(pipeline)if it changed. The closure handles per-mesh / per-material bind groups, vertex/index buffers, and drawIndexed. Returns the number of GPU draw calls.Parameters
- pass: GPURenderPassEncoder | GPURenderBundleEncoder
- engine: EngineContext
Returns number
Optionalupdate
-
Update dirty per-pass state before draw. Called once per frame per binding. Per-mesh state (e.g. world matrix) shared across bindings should be version-guarded to avoid redundant writes. Render task transparent sorting runs after these updates, so renderables may refresh
_worldCenterhere.Parameters
- context: DrawUpdateContext
Returns void
A per-pass draw binding produced by
Renderable.bind(engine, target).Target-specific GPU state (resolved pipeline(s), sceneBG, etc.) is captured in the
drawclosure so the binding itself has no material-specific payload. The sameRenderablecan be bound multiple times (once per pass it participates in) with a separateDrawBindingeach time.