CapSupport
Interface in Backends
What one capability costs on one target: the row of a backend's capProfile.
import type { CapSupport } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
interface CapSupport { readonly directive?: string; readonly hostFeature?: string;}Description
What one capability costs on one target: the row of a backend’s capProfile. Both
fields are optional and mean different things.
An empty row ({}) means the target supports the capability outright, with no directive
and no host activation (storage buffers on WGSL, float render targets on WebGPU).
Instance properties
directiveoptionalread onlystringThe token the emitted source must carry for this target to accept the feature: WGSL
enable <directive>;, GLSL ES 3.00#extension <directive> : require. When absent, the feature adds nothing to the emitted source.hostFeatureoptionalread onlystringWhat the host must activate before pipeline creation:
gl.getExtension('<hostFeature>')on WebGL2, arequiredFeatures: ['<hostFeature>']entry on WebGPU. When absent, the feature is core on that target and there is nothing to request.
Source
src/core/backend.ts, line 38, at commit 26de7be8