deno.land / std@0.224.0 / webgpu / create_capture_test.ts

create_capture_test.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// 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); },});
std

Version Info

Tagged at
6 months ago