Class Texture

A handle to a texture on the GPU.

class Texture ;

Fields

NameTypeDescription
descriptor const(__C.WGPUTextureDescriptor)Describes this texture.
label const(string)Optional, human-readable debug label for this texture.

Properties

NameTypeDescription
asImageCopy[get] __C.WGPUImageCopyTextureMake an ImageCopyTexture representing the whole texture.
bytesPerBlock[get] uintBytes per “block” of this texture.
bytesPerRow[get] uintSize of one row of a texture's pixels/blocks, in bytes.
dataLayout[get] __C.WGPUTextureDataLayoutMake a TextureDataLayout given this texture's size and TextureFormat.
defaultView[get] TextureViewCreates a default view of this whole texture.
height[get] uint
paddedBytesPerRow[get] uintSize of one row of a texture's pixels/blocks, in bytes. Aligned to COPY_BYTES_PER_ROW_ALIGNMENT.
pixelsPerBlock[get] uint
rowsPerImage[get] uint“Rows” that make up a single “image”.
size[get] __C.WGPUExtent3DSize and depth/layer count of this texture.
width[get] uint

Methods

NameDescription
asRenderTarget (blend, writeMask) Make a ColorTargetState given this texture's TextureFormat and a constant blending mode.
asRenderTarget (blend, writeMask) Make a ColorTargetState given this texture's TextureFormat and a custom blending mode.
createView (descriptor) Creates a view of this texture.
destroy () Release the given handle.
multisampleState (mask, alphaToCoverageEnabled) Creates a multisample state given this texture's TextureDescriptor.sampleCount.

See Also

wgpu::Texture