Bug 252643 - [WebGPU] GPUCommandEncoder.clearBuffer does not appear to work
Summary: [WebGPU] GPUCommandEncoder.clearBuffer does not appear to work
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 252630 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-02-20 19:18 PST by Mike Wyrzykowski
Modified: 2023-02-22 18:25 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Wyrzykowski 2023-02-20 19:18:46 PST
[WebGPU] GPUCommandEncoder.clearBuffer does not appear to work.

Apply the following patch to instanced-textured-cube.js:

diff --git a/Websites/webkit.org/demos/webgpu/scripts/instanced-textured-cube.js b/Websites/webkit.org/demos/webgpu/scripts/instanced-textured-cube.js
index 4eb3defa62d4..3820afb3770e 100644
--- a/Websites/webkit.org/demos/webgpu/scripts/instanced-textured-cube.js
+++ b/Websites/webkit.org/demos/webgpu/scripts/instanced-textured-cube.js
@@ -334,6 +334,7 @@ async function helloCube() {
         
         /* GPUCommandEncoder */
         const commandEncoder = device.createCommandEncoder();
+        commandEncoder.clearBuffer(translationBuffer);
         /* GPURenderPassEncoder */
         const renderPassEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);


it still seems to work as usual with an occasional flash. Which means the clear isn't happening in general or consistently.
Comment 1 Radar WebKit Bug Importer 2023-02-20 19:19:07 PST
<rdar://problem/105708271>
Comment 2 Mike Wyrzykowski 2023-02-20 20:20:51 PST
Pull request: https://github.com/WebKit/WebKit/pull/10425
Comment 3 EWS 2023-02-22 16:04:37 PST
Committed 260707@main (033f8d135327): <https://commits.webkit.org/260707@main>

Reviewed commits have been landed. Closing PR #10425 and removing active labels.
Comment 4 Mike Wyrzykowski 2023-02-22 18:25:24 PST
*** Bug 252630 has been marked as a duplicate of this bug. ***