OverrideDecl
인터페이스, IR 분류
A pipeline specialization constant, the declaration behind overrideConst.
import type { OverrideDecl } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
interface OverrideDecl { readonly name: string; readonly type: ShaderType; readonly default: number | boolean;}설명
On WGSL it emits a module-scope override name: type = default;, which the host
specializes through createRenderPipeline({ constants: { name } }). On GLSL ES 3.00 it
emits #define name default after the #version line, and the host specializes it by
emitting again with emitGlslModule(m, stage, { overrideValues }). The value is chosen
when the pipeline is created, so a single authored module yields as many
driver-specialized variants as the host needs, and the driver eliminates the branches
a constant turns dead. Only WGSL scalar types are allowed (bool, i32, u32,
f32); a vector, matrix, array or struct type is rejected at authoring with
SD0014.
인스턴스 속성
name읽기 전용stringtype읽기 전용ShaderTypedefault읽기 전용number | booleanThe default value emitted into the
overridedeclaration or#define: the value a pipeline gets when the host supplies nothing for this constant.
함께 보기
소스
src/core/ir/nodes.ts, 406행, 커밋 c66579bf 기준