import { createTextureWithData } from "https://deno.land/std@0.217.0/webgpu/mod.ts";
Create a GPUTexture
with data.
Examples
Example 1
Example 1
import { createTextureWithData } from "https://deno.land/std@0.217.0/webgpu/texture_with_data.ts";
const adapter = await navigator.gpu.requestAdapter();
const device = await adapter?.requestDevice()!;
createTextureWithData(device, {
format: "bgra8unorm-srgb",
size: {
width: 3,
height: 2,
},
usage: GPUTextureUsage.COPY_SRC,
}, new Uint8Array([1, 1, 1, 1, 1, 1, 1]));