Skip to content

TgpuTexture

Defined in: packages/typegpu/src/core/texture/texture.ts:193

  • TgpuNamable

TProps extends TextureProps = any

readonly [$internal]: TextureInternals

Defined in: packages/typegpu/src/core/texture/texture.ts:194


readonly [$soul]: TgpuTextureSoul<TProps>

Defined in: packages/typegpu/src/core/texture/texture.ts:195


readonly destroyed: boolean

Defined in: packages/typegpu/src/core/texture/texture.ts:198


readonly props: TProps

Defined in: packages/typegpu/src/core/texture/texture.ts:197


readonly resourceType: "texture"

Defined in: packages/typegpu/src/core/texture/texture.ts:196


readonly usableAsRender: boolean

Defined in: packages/typegpu/src/core/texture/texture.ts:203


readonly usableAsSampled: boolean

Defined in: packages/typegpu/src/core/texture/texture.ts:202


readonly usableAsStorage: boolean

Defined in: packages/typegpu/src/core/texture/texture.ts:201

$name(label): this

Defined in: packages/typegpu/src/shared/meta.ts:44

string

this

TgpuNamable.$name


$overrideFlags(flags): TgpuTexture<TProps> & StorageFlag & SampledFlag & RenderFlag

Defined in: packages/typegpu/src/core/texture/texture.ts:208

number

TgpuTexture<TProps> & StorageFlag & SampledFlag & RenderFlag


$usage<T>(…usages): TgpuTexture<TProps> & UnionToIntersection<LiteralToExtensionMap[T[number]]>

Defined in: packages/typegpu/src/core/texture/texture.ts:205

T extends AllowedUsages<TProps>[]

…T

TgpuTexture<TProps> & UnionToIntersection<LiteralToExtensionMap[T[number]]>


clear(mipLevel?): void

Defined in: packages/typegpu/src/core/texture/texture.ts:228

Clears the texture to zeros

number | "all"

void

clear(color, mipLevel?): void

Defined in: packages/typegpu/src/core/texture/texture.ts:230

Clears the texture to color. Requires the 'render' usage flag

readonly [number, number, number, number]

number | "all"

void


copyFrom<T>(source): void

Defined in: packages/typegpu/src/core/texture/texture.ts:246

Copies the contents of a texture with a matching size and format

T extends CopyCompatibleTexture<TProps>

T

void

copyFrom<T>(source, options): void

Defined in: packages/typegpu/src/core/texture/texture.ts:248

Copies a region between textures of the same format

T extends FormatCompatibleTexture<TProps>

T

TextureCopyOptions

void


createView(…args): TgpuTextureView<TextureSchemaForDescriptor<{ dimension: Default<TProps["dimension"], "2d">; multisampled: Default<TProps["sampleCount"], 1> extends 1 ? false : true; sampleType: TProps["format"] extends GPUTextureFormat ? TextureFormats[any[any]]["channelType"] : F32 | I32 | U32; }>>

Defined in: packages/typegpu/src/core/texture/texture.ts:210

…[SelfOrErrors<WgslTexture<WgslTextureProps>, ValidSampledUsage<TgpuTexture<TProps>, WgslTexture<WgslTextureProps>>>]

TgpuTextureView<TextureSchemaForDescriptor<{ dimension: Default<TProps["dimension"], "2d">; multisampled: Default<TProps["sampleCount"], 1> extends 1 ? false : true; sampleType: TProps["format"] extends GPUTextureFormat ? TextureFormats[any[any]]["channelType"] : F32 | I32 | U32; }>>

createView(schema, viewDescriptor?): TgpuTextureRenderView

Defined in: packages/typegpu/src/core/texture/texture.ts:215

"render"

TgpuTextureViewDescriptor

TgpuTextureRenderView

createView<T>(schema, viewDescriptor?): TgpuTextureView<T>

Defined in: packages/typegpu/src/core/texture/texture.ts:216

T extends WgslTexture<WgslTextureProps>

ValidateTextureViewSchema<TgpuTexture<TProps>, T>

TgpuTextureViewDescriptor & object

TgpuTextureView<T>

createView<T>(schema, viewDescriptor?): TgpuTextureView<T>

Defined in: packages/typegpu/src/core/texture/texture.ts:222

T extends WgslStorageTexture<WgslStorageTextureProps>

ValidateTextureViewSchema<TgpuTexture<TProps>, T>

TgpuTextureViewDescriptor

TgpuTextureView<T>


destroy(): void

Defined in: packages/typegpu/src/core/texture/texture.ts:250

void


generateMipmaps(baseMipLevel?, mipLevels?): void

Defined in: packages/typegpu/src/core/texture/texture.ts:231

number

number

void


write(source, options?): void

Defined in: packages/typegpu/src/core/texture/texture.ts:233

Writes image sources to the texture, one per array layer. Requires the 'render' usage flag

GPUCopyExternalImageSource | GPUCopyExternalImageSource[]

TextureWriteOptions

void

write(source, options?): void

Defined in: packages/typegpu/src/core/texture/texture.ts:238

Writes raw texel data to the texture

TypedArray | ArrayBuffer | DataView<ArrayBufferLike>

number | TextureRawWriteOptions

void


writeAsync(source, options?): Promise<void>

Defined in: packages/typegpu/src/core/texture/texture.ts:243

Decodes an image blob and writes it to the texture. Requires the 'render' usage flag

Blob

TextureBlobWriteOptions

Promise<void>

© Software Mansion 2026. All trademarks and copyrights belong to their respective owners. Read about our Privacy Policy.