ResourceKind
Type in Reflection
What a bind entry is at the host API, independent of the WGSL address space or type that declared it.
import type { ResourceKind } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
type ResourceKind = 'uniform-buffer' | 'storage-buffer' | 'texture' | 'storage-texture' | 'sampler';Description
A host switches on this field
to pick its GPU resource type. 'uniform-buffer' and 'storage-buffer' are both backed by
a buffer; the entry’s access, present only on a storage buffer, further splits it into
read-only and read-write. 'texture' and 'sampler' are the two kinds a buffer-only host
must reject. On the GLSL ES 3.00 backend a 'sampler' entry is folded into its paired
'texture' entry’s combined sampler2D uniform and gets no declaration of its own; it
still appears in bindGroups, since reflection reports the module’s structure, with
nothing separate for a host to bind.
Source
src/core/reflect.ts, line 321, at commit 26de7be8