deno.land / std@0.224.0 / webgpu / create_capture_test.ts
123456789101112131415161718192021222324252627282930313233343536// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals } from "../assert/mod.ts";import { cleanUp, ignore } from "./_test_util.ts";import { createCapture } from "./create_capture.ts";
Deno.test({ ignore, name: "createCapture()", fn: async () => { const adapter = await navigator.gpu.requestAdapter(); assert(adapter); const device = await adapter.requestDevice(); assert(device);
const { texture, outputBuffer } = createCapture(device, 2, 2);
assertEquals(texture.width, 2); assertEquals(texture.height, 2); assertEquals(texture.depthOrArrayLayers, 1); assertEquals(texture.dimension, "2d"); assertEquals( texture.usage, GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC, );
assertEquals(outputBuffer.size, 512); assertEquals( outputBuffer.usage, GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST, );
cleanUp(device); },});
Version Info