Function createTextureFromSource

  • Create a texture from a source (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,
    someCanvasOrVideoOrImageImageBitmap,
    {
    usage: GPUTextureUsage.TEXTURE_BINDING |
    GPUTextureUsage.RENDER_ATTACHMENT |
    GPUTextureUsage.COPY_DST,
    mips: true,
    }
    );

    Parameters

    Returns GPUTexture

Generated using TypeDoc