summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/unit/webgpu_test.ts5
-rw-r--r--cli/tsc/dts/lib.deno_webgpu.d.ts1
2 files changed, 6 insertions, 0 deletions
diff --git a/cli/tests/unit/webgpu_test.ts b/cli/tests/unit/webgpu_test.ts
index bcdc6b1ff..75ae34981 100644
--- a/cli/tests/unit/webgpu_test.ts
+++ b/cli/tests/unit/webgpu_test.ts
@@ -247,6 +247,11 @@ Deno.test({
Deno.close(Number(resources[resources.length - 1]));
});
+Deno.test(function getPreferredCanvasFormat() {
+ const preferredFormat = navigator.gpu.getPreferredCanvasFormat();
+ assert(preferredFormat === "bgra8unorm" || preferredFormat === "rgba8unorm");
+});
+
async function checkIsWsl() {
return Deno.build.os === "linux" && await hasMicrosoftProcVersion();
diff --git a/cli/tsc/dts/lib.deno_webgpu.d.ts b/cli/tsc/dts/lib.deno_webgpu.d.ts
index 50d9ecfb6..74fa7c907 100644
--- a/cli/tsc/dts/lib.deno_webgpu.d.ts
+++ b/cli/tsc/dts/lib.deno_webgpu.d.ts
@@ -78,6 +78,7 @@ declare class GPU {
requestAdapter(
options?: GPURequestAdapterOptions,
): Promise<GPUAdapter | null>;
+ getPreferredCanvasFormat(): GPUTextureFormat;
}
/** @category WebGPU */