UNSTABLE: Utilities for working with the Web GPU API
Functions
Creates a texture and buffer to use as a capture.
Create a GPUTexture with data.
Get various information about a specific GPUTextureFormat.
Calculates the number of bytes including necessary padding when passing a
GPUImageCopyBuffer.
Creates a new buffer while removing any unnecessary empty bytes. Useful for when wanting to save an image as a specific format.
Interfaces
Return value for createCapture.
- outputBuffer: GPUBuffer
Represents the output buffer of the rendered texture. Can then be used to access and retrieve raw image data.
- texture: GPUTexture
Texture to be used as view to render to.
Return value for getRowPadding.
Return type for describeTextureFormat.
- allowedUsages: number
Valid bits of
GPUTextureUsage. - blockDimensions: [number, number]
Dimension of a "block" of texels. This is always
[1, 1]on uncompressed textures. - blockSize: number
Size in bytes of a "block" of texels. This is the size per pixel on uncompressed textures.
- components: number
Count of components in the texture. This determines which components there will be actual data in the shader for.
- requiredFeature: GPUFeatureName
The specific feature needed to use the format, if any.
- sampleType: GPUTextureSampleType
Type of sampling that is valid for the texture.
Variables
Number of bytes per pixel.
Buffer-Texture copies must have [bytes_per_row] aligned to this number.