The page-wide rendering behaviour that depends on which GPU backend runs.
Several rendering modules need one answer per page about the backend: how
the depth-sort ordering pair is uploaded, whether a pool rebuild must evict
three's cached RenderObject, and whether WebGPU compute is available. They
used to each keep their own boolean, set from a different capability field
(apiSurface === 'webgl2', apiSurface === 'webgpu') or inferred from
another module's switch. This module derives all of them from ONE input,
RendererCapabilities.backendKind, in one pure function
(policyForBackend), so the derivations sit side by side and a reader
can see what differs between backends in one place.
Renderer setup (configureRendererBackend) is the only writer. The policy is
page-wide and the last call wins: every Luxar host on a page renders through
one backend (renderer-setup warns on a mix).
The page-wide rendering behaviour that depends on which GPU backend runs.
Several rendering modules need one answer per page about the backend: how the depth-sort ordering pair is uploaded, whether a pool rebuild must evict three's cached
RenderObject, and whether WebGPU compute is available. They used to each keep their own boolean, set from a different capability field (apiSurface === 'webgl2',apiSurface === 'webgpu') or inferred from another module's switch. This module derives all of them from ONE input, RendererCapabilities.backendKind, in one pure function (policyForBackend), so the derivations sit side by side and a reader can see what differs between backends in one place.Renderer setup (
configureRendererBackend) is the only writer. The policy is page-wide and the last call wins: every Luxar host on a page renders through one backend (renderer-setup warns on a mix).