Function describeTextureFormat

  • Get various information about a specific GPUTextureFormat.

    Parameters

    • format: GPUTextureFormat

      The format to get the information about.

    Returns TextureFormatInfo

    An object describing various properties for the provided format.

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

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