GPU blit of a fenced MacIOSurface is skipped whenever waiting on its write fence succeeds
Categories
(Core :: Graphics, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr153 | --- | unaffected |
| firefox160 | --- | wontfix |
| firefox161 | --- | wontfix |
| firefox162 | --- | fixed |
People
(Reporter: aosmond, Assigned: aosmond)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
In GLBlitHelper::BlitSdToFramebuffer, the SurfaceDescriptorMacIOSurface case looks up the surface's write fence and does:
if (gpuFence && gpuFence->ServerWait(mGL, TimeDuration::Forever())) {
return false;
}
GpuFenceMTLSharedEvent::ServerWait returns true on success (after inserting an eglWaitSync on the imported Metal shared event, or after its ClientWait fallback completes), as documented in GpuFence.h. So the blit bails out exactly when the wait works, and only goes ahead when both the server and client waits fail, i.e. when the surface may not be ready.
Before bug 2068875 the check was !sd.gpuFence()->ServerWait(...). The negation was lost when the fence lookup moved to CompositeProcessFencesHolderMap.
When the blit fails, TexUnpackSurface::BlitSd either falls back to a CPU readback (2D canvas uploads, allowFallback) or clears the texture to [0.2, 0.0, 0.2, 1.0] with a "Please file a bug!" warning.
This is latent today. The only fenced MacIOSurface I found reaching this code is a 2D canvas uploaded with texImage2D, exported via CanvasTranslator::WaitForSurface. There, BeginRead() drops the write fence first: SharedSurface_IOSurface inherits ProducerReadAcquireImpl -> ProducerAcquireImpl -> TakeAllFencesAndForget, and its ProducerReadReleaseImpl is empty. So GetWriteFence returns null by the time the blit runs. Confirmed with temporary logging on an M3 Pro (macOS 27): the descriptor carries a fencesHolderId but no write fence. That fence-dropping is a separate issue (the blit then runs without waiting for the export), but fixing it without this would make every 2D canvas -> WebGL blit on Metal ANGLE fail and fall back.
Fix: restore the negation, if (gpuFence && !gpuFence->ServerWait(...)) return false;.
| Assignee | ||
Comment 1•2 days ago
|
||
The negation was lost in bug 2068875, so the blit bailed out whenever
GpuFence::ServerWait succeeded.
Comment 2•2 days ago
|
||
Set release status flags based on info from the regressing bug 2068875
Updated•2 days ago
|
Comment 4•2 days ago
|
||
| bugherder | ||
Description
•