Capabilities
클래스, 백엔드 분류
The set of capabilities a backend supports, built from its capProfile with Capabilities.fromProfile.
import { Capabilities } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
class Capabilities설명
Membership in the profile’s keys is support, so the set and the profile are one fact.
The capability gate that runs before every emit uses it: it derives what a module needs
(a storage binding needs storageBuffer, a @compute entry needs compute, a multisampled
texture load needs msaaTextureLoad, plus whatever the module lists in enables), calls
covers(reqs), and on a miss calls missing(reqs) to name the capabilities the target
cannot emit. The thrown UnsupportedFeatureError then reads “backend ‘glsl-es300’
cannot emit this module: missing capabilities: compute”, with the whole module as context.
This is why the GLSL ES 3.00 capProfile has no row for storageBuffer, compute, or
msaaTextureLoad: the gate refuses the module before the writer sees it.
생성자
new Capabilities(private readonly set: ReadonlySet<Capability>)
인스턴스 메서드
fromProfile(profile: CapProfile): CapabilitiesThe capabilities a
capProfiledeclares, read from its keys. Build coverage this way so that profile membership and capability coverage stay one fact.has(c: Capability): booleancovers(reqs: Iterable<Capability>): booleanTrue iff this target supports everything
reqsneeds.missing(reqs: Iterable<Capability>): Capability[]
함께 보기
소스
src/core/backend.ts, 74행, 커밋 c66579bf 기준