location
이 페이지에서

location()

함수, 레이아웃 분류

Attribute a field or an entry-point parameter with @location(<n>), a slot the pipeline or the previous stage supplies, with an optional @interpolate(<mode>).

import { location } from 'typeshade'

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

구문

const location: <T extends ShaderType>(
n: number,
type: T,
interpolate?: string,
) => FieldSpec<T>

매개변수

n number

the location slot.

type T extends ShaderType

the field’s type.

interpolate선택 사항 string

the interpolation mode, such as 'flat' for an integer varying.

반환값

FieldSpec<T>

a FieldSpec for an ioStruct field map or an fn parameter record.

설명

The same helper serves an ioStruct field map and an fn parameter record.

예제

예제

const VsOut = ioStruct('VsOut', { pos: builtin('position', vec4fT), id: location(0, u32T, 'flat') })

관련 가이드

함께 보기

소스

src/core/sot.ts, 317행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고