Resource
이 페이지에서

Resource

인터페이스, 레이아웃 분류

A single-binding handle: a BindingDecl for module plus a typed access node.

import type { Resource } from 'typeshade'

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

구문

interface Resource<T extends ShaderType = ShaderType> {
readonly binding: BindingDecl;
readonly node: Node<KeyOf<T>>;
}

설명

A texture, a sampler or a host-owned uniform has no fields to proxy, so this is all the handle carries. Both resource (textures, samplers, any module-owned non-struct binding) and hostUniform (a scalar, vector or matrix uniform the host supplies) return it, which is why it is generic over the resource type: node keeps the specific T (Node<'texture_2d<f32>'>, Node<'sampler'>, Node<'vec4<f32>'>), so type-specific operations (textureSample, .mul) stay type-checked at the call site.

인스턴스 속성

binding읽기 전용 BindingDecl

The binding declaration, for module({ bindings }).

node읽기 전용 Node<KeyOf<T>>

The typed access node, keyed by the declared type T.

함께 보기

소스

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

이 페이지 편집 문제 보고