Closed Bug 1935759 Opened 2 months ago Closed 2 months ago

Canvas clipping issues with hardware acceleration enabled on Firefox 133 (Intel Iris Xe Graphics)

Categories

(Core :: Graphics: Canvas2D, defect)

Firefox 133
Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox133 --- wontfix
firefox134 --- fixed
firefox135 --- fixed

People

(Reporter: olivier.belzile, Assigned: lsalzman)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

Attached image actual.png

Steps to reproduce:

Using the canvas clip method in JavaScript to draw an image decomposed in multiple triangles.

Actual results:

Some triangle paths clipping seems to work ok while in some others we cannot see the image at all.

Expected results:

Each triangle should have been drawn next to each other giving a complete picture.
Expected result is achieved when hardware acceleration is disabled.

Attached image expected.png

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: Canvas2D' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: Canvas2D
Product: Firefox → Core
  1. Type "about:support" in Firefox and copy-paste its contents here
  2. Please share a testcase that reproduces this issue for you
Flags: needinfo?(olivier.belzile)
Here is the content frpm about:support. Will try to provide a simple testcase soon. Thank you.

Here is the content from about:support. Will try to provide a simple testcase soon. Thank you.

Flags: needinfo?(olivier.belzile)

Bug can be replicated here when hardware acceleration is enabled on some video card I think, but not on some others.
https://codepen.io/olivier-belzile/pen/KwPMpQG

On line 11, change the subdivs count. Value of 1 and 2 seems ok. Value of 3 or above shows red triangles. See new attachment.

Attached image codepen_issue.png

I cannot repro on my AMD iGPU machine. This may be GPU driver specific.

Summary: Canvas clipping issues with hardware acceleration enabled on Firefox 133 → Canvas clipping issues with hardware acceleration enabled on Firefox 133 (Intel Iris Xe Graphics)
Blocks: gpu-canvas
Severity: -- → S3
OS: Unspecified → Windows
See Also: → 1936203
Duplicate of this bug: 1936203

The Windows Intel D3D driver does not seem to be recognizing that the clip mask
texture's data has changed unless the texture binding is re-latched. This causes
clipping to seemingly use an old version of the clip mask's contents.

To work around this bug, the clip mask is instead built on texture unit 0, and
then only bound on texture unit 1 after it is modified, so that the binding is
only re-latched on texture unit 1 after modification.

Assignee: nobody → lsalzman
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9443766 - Attachment description: Bug 1935759 - Work around Intel driver bug when binding clip mask. r?aosmond → Bug 1935759 - Work around Intel driver bug when binding clip mask. r?tnikkel
Pushed by lsalzman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d1e94678320b Work around Intel driver bug when binding clip mask. r=tnikkel
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch

Comment on attachment 9443766 [details]
Bug 1935759 - Work around Intel driver bug when binding clip mask. r?tnikkel

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: Buggy/wrong Canvas2D rendering on potentially everyone with Windows + Intel IGP. The driver bug doesn't seem to affect other platforms, but Windows + Intel IGP is our largest user subpopulation.
  • Is this code covered by automated tests?: Unknown
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This just replaces a WebGL texture binding sequence with an equally valid code sequence that doesn't aggravate the Intel driver bug and is low risk on other platforms too. Verified locally that this does fix the issue.
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9443766 - Flags: approval-mozilla-release?
Attachment #9443766 - Flags: approval-mozilla-beta?

Comment on attachment 9443766 [details]
Bug 1935759 - Work around Intel driver bug when binding clip mask. r?tnikkel

We don't have any more Fx133 releases before Fx134 ships.

Attachment #9443766 - Flags: approval-mozilla-release? → approval-mozilla-release-

Thanks for the quick fix!
Can we expect it to be included in Fx134? What's the planned release date?

Comment on attachment 9443766 [details]
Bug 1935759 - Work around Intel driver bug when binding clip mask. r?tnikkel

Approved for 134 RC1.

(In reply to Olivier Belzile from comment #15)

Can we expect it to be included in Fx134? What's the planned release date?

Fx134 ships on Jan 7.

Attachment #9443766 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: