Bug 267584
| Summary: | Silent failure when creating additional createCommandEncoder | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Aura Munoz <aura.munoz> |
| Component: | WebGPU | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Minor | CC: | mwyrzykowski, tzagallo, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Mac (Apple Silicon) | ||
| OS: | macOS 14 | ||
Aura Munoz
When incorrectly creating an additional command encoder in the render loop, Safari freezes and turns the whole application unresponsive. Instead, it should throw a warning or an error
Just add an additional device.createCommandEncoder(); to the webGPU samples https://github.com/webgpu/webgpu-samples/blob/0721d17d9f489b7b4fb1091f98282627c6f5d173/src/sample/rotatingCube/main.ts#L182
```
function frame() {
// Sample is no longer the active page.
if (!pageState.active) return;
const transformationMatrix = getTransformationMatrix();
device.queue.writeBuffer(
uniformBuffer,
0,
transformationMatrix.buffer,
transformationMatrix.byteOffset,
transformationMatrix.byteLength
);
renderPassDescriptor.colorAttachments[0].view = context
.getCurrentTexture()
.createView();
const commandEncoderOther = device.createCommandEncoder();
const commandEncoder = device.createCommandEncoder();
const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
passEncoder.setPipeline(pipeline);
passEncoder.setBindGroup(0, uniformBindGroup);
passEncoder.setVertexBuffer(0, verticesBuffer);
passEncoder.draw(cubeVertexCount, 1, 0, 0);
passEncoder.end();
device.queue.submit([commandEncoder.finish()]);
requestAnimationFrame(frame);
}
requestAnimationFrame(frame);
};
```
This will freeze Safari
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Mike Wyrzykowski
Likely dupe of https://bugs.webkit.org/show_bug.cgi?id=267285
validation for command encoding is not yet implemented
Radar WebKit Bug Importer
<rdar://problem/121441067>