Skip to content

TgpuTexture

  • TgpuNamable

TProps extends TextureProps = TextureProps

all properties that distinguish this texture apart from other textures on the type level.

readonly [$internal]: TextureInternals

packages/typegpu/src/core/texture/texture.ts:190


readonly aspects: AspectsForFormat<TProps["format"]>

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


readonly destroyed: boolean

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


readonly props: TProps

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


readonly resourceType: "texture"

packages/typegpu/src/core/texture/texture.ts:191


readonly usableAsRender: boolean

packages/typegpu/src/core/texture/texture.ts:199


readonly usableAsSampled: boolean

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


readonly usableAsStorage: boolean

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

$name(label): this

string

this

TgpuNamable.$name

packages/typegpu/src/shared/meta.ts:87


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

T extends AllowedUsages<TProps>[]

T

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

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


clear(mipLevel?): void

number | "all"

void

packages/typegpu/src/core/texture/texture.ts:219


copyFrom<T>(source): void

T extends CopyCompatibleTexture<TProps>

T

void

packages/typegpu/src/core/texture/texture.ts:224


createView(…args): TgpuTextureView<TextureSchemaForDescriptor<object>>

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

TgpuTextureView<TextureSchemaForDescriptor<object>>

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

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

T extends WgslTexture<WgslTextureProps> | WgslStorageTexture<WgslStorageTextureProps>

ValidateTextureViewSchema<TgpuTexture<TProps>, T>

TgpuTextureViewDescriptor & object

TgpuTextureView<T>

packages/typegpu/src/core/texture/texture.ts:209


destroy(): void

void

packages/typegpu/src/core/texture/texture.ts:226


generateMipmaps(baseMipLevel?, mipLevels?): void

number

number

void

packages/typegpu/src/core/texture/texture.ts:220


write(source): void

ExternalImageSource | ExternalImageSource[]

void

packages/typegpu/src/core/texture/texture.ts:221

write(source, mipLevel?): void

TypedArray | ArrayBuffer | DataView<ArrayBufferLike>

number

void

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