RenderState
이 페이지에서

RenderState

인터페이스, 런타임 분류

The fixed-function state of a render pipeline, which the host writes: the compiler knows its entries' inputs and outputs, and the runtime fills and checks those.

import type { RenderState } from 'typeshade/runtime'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

interface RenderState {
readonly vertex?: string;
readonly fragment?: string | null;
readonly targets?: readonly TargetState[];
readonly depth?: { readonly format: string; readonly compare?: string; readonly write?: boolean; };
readonly primitive?: { readonly topology?: string; readonly cullMode?: 'none' | 'front' | 'back'; readonly frontFace?: 'ccw' | 'cw'; };
readonly multisample?: { readonly count?: number };
readonly constants?: Constants;
}

인스턴스 속성

vertex선택 사항읽기 전용 string

The vertex entry; the program’s only one when omitted.

fragment선택 사항읽기 전용 string | null

The fragment entry; the program’s only one when omitted, none for a depth-only pass.

targets선택 사항읽기 전용 readonly TargetState[]

One per colour output, by location. Omitted: rgba8unorm for each.

depth선택 사항읽기 전용 { readonly format: string; readonly compare?: string; readonly write?: boolean; }

The depth attachment’s format, and how the pipeline tests and writes it: compare defaults to 'less' and write to true. A reversed projection compares 'greater', and a pass drawn behind everything else (a sky) compares 'always' and does not write. Omitted: no depth test, for a pass with no depth attachment.

primitive선택 사항읽기 전용 { readonly topology?: string; readonly cullMode?: 'none' | 'front' | 'back'; readonly frontFace?: 'ccw' | 'cw'; }

What the vertices make: topology defaults to 'triangle-list', cullMode to 'none' and frontFace to 'ccw'.

multisample선택 사항읽기 전용 { readonly count?: number }

The sample count of the targets it draws into: 1 when omitted, 4 for a multisampled target.

constants선택 사항읽기 전용 Constants

The values of the program’s overrides (surface §15), by the names the source declares: { quality: 3 }. The vertex and the fragment stage are each created with them, as WebGPU’s constants. An override the record leaves out takes the default its declaration states, so omitted, every override does. An f32 takes a finite number no larger than 3.4028234663852886e38 in magnitude, an i32 or a u32 a whole number in its range, and a bool a boolean or a number, where 0 is false. A name the program does not declare is a TypeError that names the program’s overrides, and a value its type cannot hold one that says what the type takes. Two states that differ in an override are two pipelines, and the same values give the same pipeline back.

소스

src/runtime/program.ts, 64행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고