summaryrefslogtreecommitdiff
path: root/tests/unit/webgpu_test.ts
diff options
context:
space:
mode:
authorchirsz <chirsz@foxmail.com>2024-05-21 04:47:04 +0800
committerGitHub <noreply@github.com>2024-05-20 13:47:04 -0700
commit529356cc120a3b2f7b13131e5a5117b093e11158 (patch)
treee5d4d6a069d8d92fdf17d80e76875205ef0a7669 /tests/unit/webgpu_test.ts
parentc89f9f9ad1e3d940a460092ee7bc44eb046fa1e1 (diff)
fix(ext/webgpu): Allow `depthClearValue` to be undefined when `depthLoadOp` is not "clear" (#23850)
Diffstat (limited to 'tests/unit/webgpu_test.ts')
-rw-r--r--tests/unit/webgpu_test.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/unit/webgpu_test.ts b/tests/unit/webgpu_test.ts
index f31010297..9947ea32b 100644
--- a/tests/unit/webgpu_test.ts
+++ b/tests/unit/webgpu_test.ts
@@ -496,6 +496,36 @@ Deno.test({
device.destroy();
});
+Deno.test({
+ ignore: isWsl || isLinuxOrMacCI,
+}, async function beginRenderPassWithoutDepthClearValue() {
+ const adapter = await navigator.gpu.requestAdapter();
+ assert(adapter);
+ const device = await adapter.requestDevice();
+ assert(device);
+
+ const encoder = device.createCommandEncoder();
+
+ const depthTexture = device.createTexture({
+ size: [256, 256],
+ format: "depth32float",
+ usage: GPUTextureUsage.RENDER_ATTACHMENT,
+ });
+ const depthView = depthTexture.createView();
+
+ const renderPass = encoder.beginRenderPass({
+ colorAttachments: [],
+ depthStencilAttachment: {
+ view: depthView,
+ depthLoadOp: "load",
+ },
+ });
+
+ assert(renderPass);
+
+ device.destroy();
+});
+
async function checkIsWsl() {
return Deno.build.os === "linux" && await hasMicrosoftProcVersion();