Renderer · interface

DescribeGpuOptions

The seams a test needs. A caller in a browser passes none of them.

Explained in Hello world.

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

Properties

NameTypeDescription
preferWebGpureadonlyoptionalbooleanWhether to ask WebGPU first. Defaults to true, matching createRenderer.
gpureadonlyoptionalGPU | nullDefaults to navigator.gpu.
createCanvasreadonlyoptional() => HTMLCanvasElement | nullWhere the WebGL2 fallback reads its string from. Defaults to a detached canvas.
More

Detached, and that is the whole reason this is not read off the caller's canvas. A second getContext('webgl2') on one canvas returns the existing context and silently ignores the attributes, so whoever calls first decides alpha, antialias and powerPreference for everybody — and Renderer chooses antialias from the very profile a caller is here to decide. Reading the name off the real canvas would settle a rendering attribute as a side effect of asking a question. webgl2/renderer.ts records the same trap from the other side, where a consumer doing this by hand was the bug.