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.
mips: true
Example:
const texture = createTextureFromSource( device, [ someCanvasOrVideoOrImageImageBitmap0, someCanvasOrVideoOrImageImageBitmap1, ], { usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_DST, mips: true, }); Copy
const texture = createTextureFromSource( device, [ someCanvasOrVideoOrImageImageBitmap0, someCanvasOrVideoOrImageImageBitmap1, ], { usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_DST, mips: true, });
Generated using TypeDoc
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: