Point the backend-dependent rendering paths at renderer. Every renderer
Luxar draws through needs this — the app's own (both create*Renderer
below) and a host's in layer mode (core/layer/luxar-layer.ts) — because
each switch is a module default tuned for classic WebGL:
element textures are laid out against the device's maxTextureSize;
both WebGPU backends ignore texture update ranges, so element textures
upload only their dirty rows there (#2944) — a no-op on classic WebGL;
chunked ordering applies need honoured attribute update ranges and the
onUploadCallback back-pressure, which neither WebGPU backend fires —
classic WebGL only (see element-storage's chunked-apply note);
RenderObject eviction (dispose dispatch) flushes the stale vertexBuffers
chainMap cache only WebGPU keeps; on classic WebGL the same event
destroys the compiled program (a shader recompile), so WebGPU only.
Call after the renderer is initialised (WebGPU's backend exists only after
init()).
The switches are page-wide and the last call wins, so every Luxar host on a
page (a LuxarApp, LuxarLayers) must render through ONE backend. Not enforced
— a page may re-init on another backend once the first host is gone — but a
call that switches the backend warns once.
Point the backend-dependent rendering paths at
renderer. Every renderer Luxar draws through needs this — the app's own (bothcreate*Rendererbelow) and a host's in layer mode (core/layer/luxar-layer.ts) — because each switch is a module default tuned for classic WebGL:maxTextureSize;onUploadCallbackback-pressure, which neither WebGPU backend fires — classic WebGL only (see element-storage's chunked-apply note);Call after the renderer is initialised (WebGPU's backend exists only after
init()).The switches are page-wide and the last call wins, so every Luxar host on a page (a LuxarApp, LuxarLayers) must render through ONE backend. Not enforced — a page may re-init on another backend once the first host is gone — but a call that switches the backend warns once.