From 529356cc120a3b2f7b13131e5a5117b093e11158 Mon Sep 17 00:00:00 2001 From: chirsz Date: Tue, 21 May 2024 04:47:04 +0800 Subject: fix(ext/webgpu): Allow `depthClearValue` to be undefined when `depthLoadOp` is not "clear" (#23850) --- tests/unit/webgpu_test.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests/unit') 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(); -- cgit v1.2.3