Renderer · interface

CreatedRenderer

What was built, and which path built it.

Explained in Hello world.

interface CreatedRenderer
import type { CreatedRenderer } from '@driftengine/core';

Properties

NameTypeDescription
rendererreadonlyRendererApiThe renderer, behind the surface both backends satisfy.
backendreadonlyRenderBackendWhich backend is actually drawing. Report this; never infer it.
reasonreadonlystringWhy that backend, in words, for the frame meter and for bug reports.
rendererNamereadonlystringWhat the part calls itself, from whichever backend was actually built.
More

The third of the same kind of fact as backend and reason, and it was the one missing. select.ts already carried it to hand the WebGPU renderer a part number for the capability clamp, and then dropped it here — so gpuCapability.ts's own claim that the string "is reported in the game's boot log, because the string a real device gives settles it in one message" was true of this repository's harness and not of a consumer, whose boot log could not print what it was never handed. Reported from outside 2026-08-28 as exactly that: a bug report that cannot say which GPU it came from.

'' where the browser declined to name the part, which is an ordinary answer rather than a failure — see webgl2RendererName.

For a log and a bug report, not for choosing a profile. By the time this exists the renderer is built and every setting except the pixel density is memory allocated at construction. describeGpu() is the same question asked early enough to act on.

reversedDepthreadonlybooleanWhich way this renderer's depth buffer actually runs.
More

The answer a consumer has to key their near plane on, and it is the runtime one. The engine's own wish is the REVERSED_DEPTH constant; this is what the context granted. On WebGPU they always agree, because its clip space is already [0, 1]. On WebGL2 they can differ: reversing needs EXT_clip_control, and a context without it keeps the conventional sense — so a game that read the constant would pick a near plane the machine in front of it cannot honour.

Why it is reported at all. A conventional buffer resolves about z² / (near · 2^bits), which makes the near plane the only control there is, and a consumer that cannot ask has to choose for the worse case and gains nothing from the better one. Reported the way rendererName is, and for the same reason: it is a fact about the machine that only the renderer knows.

pipelinereadonlyRenderPipelineWhich pipeline is drawing: the forward path, or the one driven from buffers the GPU wrote.
More

Reported for the same reason backend is — a consumer who asked for one and got the other has to be able to find out. They cannot, here: asking for gpu-driven on a backend that cannot run it throws rather than answering forward. See CreateRendererOptions.pipeline.