Renderer · interface
CreateRendererOptions
Explained in Hello world.
interface CreateRendererOptionsimport type { CreateRendererOptions } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
preferWebGpureadonlyoptional | boolean | Whether to try WebGPU at all. Defaults to true: WebGPU is the backend this engine is
built on now, and WebGL2 is the fallback beneath it rather than the path of record.MoreIt defaulted to false for as long as the second backend was under construction, and the
comment holding it there pointed at a numbered task in a plan. That is how a default
outlives its reason: by the time it was wrong, every consumer in the workspace was already
passing What this costs is an |
pipelinereadonlyoptional | RenderPipeline | Which pipeline to draw with. Defaults to 'forward'.More
Asking for it where it cannot run throws. Not a warning and not a fallback: a silent
fallback means a consumer ships believing they have a pipeline they do not, and the difference
only shows as a frame time on somebody else's machine. The throw carries the reason in words,
from This includes a WebGPU request that fell back, which is the case a check written against the asked-for backend would miss: every fallback path here is a path where the pipeline became unavailable after the choice was made. |
searchreadonlyoptional | string | The query string to read ?backend= from. Defaults to the document's own.MoreInjectable because a test has no |
probeShadersreadonlyoptional | readonly string[] | Shader sources the acceptance probe compiles before a device is accepted. Empty by default.MoreEmpty because it was measured, not assumed. On an AMD Radeon RX 9070 XT (RADV, ANGLE over
Vulkan) the draw-and-read check alone costs 4.2–5.4 ms and catches a device that validates
everything and rasterises nothing; adding all 46 generated WGSL modules costs a further
58–62 ms on every boot and catches the class that
What would make an empty default wrong is a device-specific compile failure in a shader
that test cannot model — which is precisely what the iOS black screen was before that test
existed. A consumer shipping to a platform nobody has certified should pass the real set and
take the cost: a slower boot is worth more than a black screen. |
backendTimeoutMsreadonlyoptional | number | How long the WebGPU path may take before WebGL2 is answered instead. Infinity waits forever.MoreA preference that cannot fall back is not a preference. Every other refusal arrives as an
answer — a null adapter, a throw, a device that cannot draw — and each lands on WebGL2 with a
reason. A request that never settles is none of those and has nothing under it: the boot stops
at an |
splashreadonlyoptional | boolean | SplashOptions | The engine badge shown over the page until the first frame reaches the screen.MoreOn by default, and that default is the feature. A web-delivered game has no shell to
show one for it —
|
highDynamicRangeDisplayreadonlyoptional | () => boolean | Whether the display shows a high dynamic range, asked only where highDynamicRange was. The
browser's (dynamic-range: high) query by default; a host with no DOM, or one that knows
better about its own display, answers instead. See displayRange.ts. |