-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some assertions when using a canvas without a layer with webgpu
https://bugs.webkit.org/show_bug.cgi?id=270705 rdar://124213314 Reviewed by Mike Wyrzykowski. The test in this PR hit several issues: 1. PresentationContextIOSurface::present asserted, which I changed to an early return. 2. I handle errors when creating objects by returning nullptr instead of an object that has no corresponding object in the GPU process, and propogate those errors to JS. 3. I added a WeakPtr check in the lambda in GPUCanvasContextCocoa::prepareForDisplay 4. In order to keep Windows building after this change, I needed to change FontPlatformData::Attributes to FontPlatformDataAttributes in WebKit. * LayoutTests/fast/webgpu/use-canvas-without-layer-expected.txt: Added. * LayoutTests/fast/webgpu/use-canvas-without-layer.html: Added. * Source/WebGPU/WebGPU/PresentationContextIOSurface.mm: * Source/WebKit/Platform/IPC/StreamServerConnection.cpp: (IPC::StreamServerConnection::dispatchStreamMessages): * Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.cpp: (WebKit::WebGPU::RemoteTextureProxy::~RemoteTextureProxy): (WebKit::WebGPU::RemoteTextureProxy::createView): (WebKit::WebGPU::RemoteTextureProxy::destroy): (WebKit::WebGPU::RemoteTextureProxy::setLabelInternal): * Source/WebKit/WebProcess/GPU/graphics/WebGPU/RemoteTextureProxy.h: Canonical link: https://commits.webkit.org/276005@main
- Loading branch information
1 parent
09186d9
commit f816a17
Showing
62 changed files
with
469 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This test passes if it does not crash. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script> | ||
if (window.testRunner) { testRunner.waitUntilDone(); testRunner.dumpAsText() } | ||
onload = async () => { | ||
try { | ||
let adapter12 = await navigator.gpu.requestAdapter({ }); | ||
let device10 = await adapter12.requestDevice({ label: '\u0678' } ); | ||
let canvas25 = document.createElement('canvas'); | ||
canvas25.height = 1419621282; | ||
let gpuCanvasContext17 = canvas25.getContext('webgpu'); | ||
gpuCanvasContext17.configure( | ||
{ | ||
device: device10, | ||
format: 'rgba16float', | ||
colorSpace: 'srgb', | ||
alphaMode: 'premultiplied', | ||
} | ||
); | ||
let texture95 = gpuCanvasContext17.getCurrentTexture(); | ||
} catch (e) { } | ||
if (window.testRunner) { testRunner.notifyDone() } | ||
}; | ||
</script> | ||
This test passes if it does not crash. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.