Skip to content

TgpuTexture

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

  • TgpuNamable

TProps extends TextureProps = any

readonly [$internal]: TextureInternals

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


readonly [$soul]: TgpuTextureSoul<TProps>

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


readonly destroyed: boolean

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


readonly props: TProps

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


readonly resourceType: "texture"

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


readonly usableAsRender: boolean

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


readonly usableAsSampled: boolean

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


readonly usableAsStorage: boolean

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

$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:207

number

TgpuTexture<TProps> & StorageFlag & SampledFlag & RenderFlag


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

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

T extends AllowedUsages<TProps>[]

…T

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


clear(mipLevel?): void

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

Clears the texture to zeros

number | "all"

void

clear(color, mipLevel?): void

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

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:245

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:247

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:209

…[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:214

"render"

TgpuTextureViewDescriptor

TgpuTextureRenderView

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

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

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:221

T extends WgslStorageTexture<WgslStorageTextureProps>

ValidateTextureViewSchema<TgpuTexture<TProps>, T>

TgpuTextureViewDescriptor

TgpuTextureView<T>


destroy(): void

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

void


generateMipmaps(baseMipLevel?, mipLevels?): void

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

number

number

void


write(source, options?): void

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

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:237

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:242

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.