Probe which graphics backend is physically running behind
?renderer=webgpu, for specs that must skip on the WebGL2 fallback.
capabilities.apiSurface === 'webgpu' does NOT answer this: it is
'webgpu' for any active WebGPURenderer, including one whose
internal backend has fallen back to WebGL2 — the headless-chromium
norm. That field means "which method-signature contract should I
follow?", not "which GPU backend is running?" (#1449). So isNative
reads the backend's own flag and nothing else, which also leaves
apiSurface free to be asserted by callers rather than assumed.
The tell is deliberately POSITIVE (isWebGPUBackend === true, set by
three's WebGPUBackend constructor): a negative isWebGLBackend !== true check fails OPEN under structural drift — a renamed flag, a
third backend, a wrapped backend — silently restoring the very
fail-open behaviour #1449 fixed. The positive form fails closed
(skip), mirroring isWebGLRenderer in rendering/renderer-capabilities.ts.
Call this only AFTER waitForLuxarReady. WebGPURenderer constructs a
WebGPUBackend eagerly and replacesthis.backend with a
WebGLBackend from inside init() when no adapter can be acquired, so a
probe that races the viewer's await renderer.init() reads the optimistic
pre-fallback value and reports a native backend that isn't there.
Probe which graphics backend is physically running behind
?renderer=webgpu, for specs that must skip on the WebGL2 fallback.capabilities.apiSurface === 'webgpu'does NOT answer this: it is'webgpu'for any activeWebGPURenderer, including one whose internal backend has fallen back to WebGL2 — the headless-chromium norm. That field means "which method-signature contract should I follow?", not "which GPU backend is running?" (#1449). SoisNativereads the backend's own flag and nothing else, which also leavesapiSurfacefree to be asserted by callers rather than assumed.The tell is deliberately POSITIVE (
isWebGPUBackend === true, set by three'sWebGPUBackendconstructor): a negativeisWebGLBackend !== truecheck fails OPEN under structural drift — a renamed flag, a third backend, a wrappedbackend— silently restoring the very fail-open behaviour #1449 fixed. The positive form fails closed (skip), mirroringisWebGLRendererinrendering/renderer-capabilities.ts.Call this only AFTER
waitForLuxarReady.WebGPURendererconstructs aWebGPUBackendeagerly and replacesthis.backendwith aWebGLBackendfrom insideinit()when no adapter can be acquired, so a probe that races the viewer'sawait renderer.init()reads the optimistic pre-fallback value and reports a native backend that isn't there.