TextureOptions
On this page

TextureOptions

Interface in Runtime

What rt.texture() makes. format is any GPUTextureFormat the device can render to or sample: rgba8unorm, rgba16float, depth24plus, r32float.

import type { TextureOptions } from 'typeshade/runtime'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

interface TextureOptions {
readonly size: readonly [number, number] | readonly [number, number, number];
readonly format: string;
readonly dimension?: '2d' | '3d';
readonly sampleCount?: number;
readonly storage?: boolean;
}

Instance properties

sizeread only readonly [number, number] | readonly [number, number, number]

[width, height], or [width, height, layers] for an array or a 3D texture.

formatread only string
dimensionoptionalread only '2d' | '3d'

'2d' (the default) or '3d'. A texture is a render target and a sampled texture at once, and one with a single sample can be copied to and from.

sampleCountoptionalread only number

4 for a multisampled render target; 1, the default, otherwise.

storageoptionalread only boolean

Add STORAGE_BINDING, for a storage texture an entry writes.

Source

src/runtime/resources.ts, line 18, at commit 26de7be8

Edit this page Report a problem