mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
test(webgpu): remove Deno.resources()
usage (#4708)
This commit is contained in:
parent
c53ca87301
commit
6deab72a00
@ -29,14 +29,3 @@ const isLinuxOrMacCI =
|
||||
const isWsl = await checkIsWsl();
|
||||
|
||||
export const ignore = isWsl || isLinuxOrMacCI;
|
||||
|
||||
export function cleanUp(device: GPUDevice) {
|
||||
device.destroy();
|
||||
|
||||
// TODO(lucacasonato): webgpu spec should add a explicit destroy method for
|
||||
// adapters.
|
||||
// @ts-ignore Until WebGPU resources cleanup is automatically handled.
|
||||
const resources = Object.keys(Deno[Deno.internal].core.resources());
|
||||
// @ts-ignore Until WebGPU resources cleanup is automatically handled.
|
||||
Deno[Deno.internal].core.close(Number(resources[resources.length - 1]));
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { assert, assertEquals } from "@std/assert";
|
||||
import { cleanUp, ignore } from "./_test_util.ts";
|
||||
import { ignore } from "./_test_util.ts";
|
||||
import { createCapture } from "./create_capture.ts";
|
||||
|
||||
Deno.test({
|
||||
@ -30,6 +30,6 @@ Deno.test({
|
||||
GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST,
|
||||
);
|
||||
|
||||
cleanUp(device);
|
||||
device.destroy();
|
||||
},
|
||||
});
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import { assert } from "@std/assert/assert";
|
||||
import { createTextureWithData } from "./texture_with_data.ts";
|
||||
import { cleanUp, ignore } from "./_test_util.ts";
|
||||
import { ignore } from "./_test_util.ts";
|
||||
|
||||
Deno.test({
|
||||
ignore,
|
||||
@ -22,6 +22,6 @@ Deno.test({
|
||||
usage: GPUTextureUsage.COPY_SRC,
|
||||
}, new Uint8Array([1, 1, 1, 1, 1, 1, 1]));
|
||||
|
||||
cleanUp(device);
|
||||
device.destroy();
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user