describeTextureFormat

import { describeTextureFormat } from "jsr:@ende/webgpu";

function

function describeTextureFormat(format: GPUTextureFormat): TextureFormatInfo

Get various information about a specific GPUTextureFormat.

format: GPUTextureFormat

The format to get the information about.

Returns

An object describing various properties for the provided format.

Example: Basic usage

import { describeTextureFormat } from "@ende/webgpu/describe-texture-format";
import { assertEquals } from "@ende/assert";

assertEquals(describeTextureFormat("rgba8unorm"), {
  sampleType: "float",
  allowedUsages: 31,
  blockDimensions: [1, 1],
  blockSize: 4,
  components: 4,
});

Source