Closed Bug 2075873 Opened 2 months ago Closed 1 month ago

[wpt-sync] Sync PR 62992 - webgl: Initialize stencil writemask to all ones and restore clear values

Categories

(Core :: Graphics: CanvasWebGL, task, P4)

task

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox159 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 62992 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/62992
Details from upstream follow.

mxmgorin <102797145+mxmgorin@users.noreply.github.com> wrote:

webgl: Initialize stencil writemask to all ones and restore clear values

This fixes two issues in the state restored by the WebGL thread after binding or initializing a framebuffer:

  • The initial stencil writemask was zero instead of all ones. Creating a context and binding a framebuffer restore it from GLState, so stencil writes were dropped until the page called stencilMask, and getParameter(STENCIL_WRITEMASK) returned 0.
  • restore_invariant did not restore the depth and stencil clear values. The first clear of a framebuffer created by the page lazily initializes its attachments with clearDepth(1) and clearStencil(0), so a clearDepth or clearStencil set before that clear was replaced by the defaults.

Testing: Added mozilla/webgl/framebuffer-initial-state.html. All four of its subtests fail without this change.
conformance2/rendering/blitframebuffer-stencil-only.html now passes in full, so its expectations are removed.
Found while testing the web version of FTL from Humble Bundle, whose map renders empty without this change.
Reviewed in servo/servo#48423

Component: web-platform-tests → Graphics: WebGPU
Product: Testing → Core

CI Results

Ran 10 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 12 tests

Status Summary

Firefox

OK : 1
PASS: 4

Chrome

OK : 1
PASS: 4

Safari

OK : 1
PASS: 4

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Component: Graphics: WebGPU → Graphics: CanvasWebGL
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8b7104f2520d https://hg.mozilla.org/integration/autoland/rev/a7c35786b3a7 [wpt PR 62992] - webgl: Initialize stencil writemask to all ones and restore clear values, a=testonly
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
You need to log in before you can comment on or make changes to this bug.