close
Skip to main content

@std/webgpu@0.224.9

Works with
This package works with Deno, BrowsersIt is unknown whether this package works with Bun
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score94%
Downloads12/wk
Published8 months ago (0.224.9)

UNSTABLE: Utilities for working with the Web GPU API

Functions

f
createCapture(
device: GPUDevice,
width: number,
height: number
): CreateCapture

Creates a texture and buffer to use as a capture.

f
createTextureWithData(
device: GPUDevice,
descriptor: GPUTextureDescriptor,
data: Uint8Array_
): GPUTexture

Create a GPUTexture with data.

f
describeTextureFormat(format: GPUTextureFormat): TextureFormatInfo

Get various information about a specific GPUTextureFormat.

f
getRowPadding(width: number): Padding

Calculates the number of bytes including necessary padding when passing a GPUImageCopyBuffer.

f
resliceBufferWithPadding(
buffer: Uint8Array,
width: number,
height: number
): Uint8Array

Creates a new buffer while removing any unnecessary empty bytes. Useful for when wanting to save an image as a specific format.

Interfaces

I

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.

I

Return value for getRowPadding.

  • padded: number

    The number of bytes per row with padding calculated.

  • unpadded: number

    The number of bytes per row without padding calculated.

  • 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

v

Number of bytes per pixel.

v

Buffer-Texture copies must have [bytes_per_row] aligned to this number.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/webgpu

Import symbol

import * as mod from "@std/webgpu";
or

Import directly with a jsr specifier

import * as mod from "jsr:@std/webgpu";