Bug 252643

Summary: [WebGPU] GPUCommandEncoder.clearBuffer does not appear to work
Product: WebKit Reporter: Mike Wyrzykowski <mwyrzykowski>
Component: WebGPUAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

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. ***