TextureElem
타입, 타입 분류
The element type of a sampled texture: WGSL's texture_2d<T> type parameter, or GLSL ES 3.00's sampler prefix.
import type { TextureElem } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
type TextureElem = 'f32' | 'u32' | 'i32';설명
All three are core in both targets.
An integer texture is unfilterable: interpolating integer texels is undefined, and WGSL
rejects textureSample on a texture_2d<u32>. GLSL would accept texture(usampler2D, …)
with nearest filtering, but a construct that compiles on WebGL2 and cannot be expressed on
WebGPU is what authoring once for both targets is meant to rule out. Read an integer
texture with textureLoad, textureDimensions and textureNumLayers;
textureSample and textureSampleLevel on an integer key are tsc errors.
함께 보기
소스
src/core/ir/types.ts, 33행, 커밋 c66579bf 기준