Function createTextureFromSources

  • Create a texture from an array of sources (Video, Canvas, OffscreenCanvas, ImageBitmap) and optionally create mip levels. If you set mips: true and don't set a mipLevelCount then it will automatically make the correct number of mip levels.

    Example:

    const texture = createTextureFromSource(
    device,
    [
    someCanvasOrVideoOrImageImageBitmap0,
    someCanvasOrVideoOrImageImageBitmap1,
    ],
    {
    usage: GPUTextureUsage.TEXTURE_BINDING |
    GPUTextureUsage.RENDER_ATTACHMENT |
    GPUTextureUsage.COPY_DST,
    mips: true,
    }
    );

    Parameters

    Returns GPUTexture

Generated using TypeDoc