Closed Bug 1795510 Opened 2 years ago Closed 2 years ago

Perspective property makes box-shadow render incorrectly (With sw-wr enabled)

Categories

(Core :: Graphics: WebRender, defect)

Firefox 102
defect

Tracking

()

VERIFIED FIXED
108 Branch
Tracking Status
firefox108 --- verified
firefox109 --- verified

People

(Reporter: blendertut, Assigned: lsalzman)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

Attached image image.png

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

This markup:
<div class="parentt">

<div class="shadow">
<p>The shadow is broken".</p>
</div>
</div>

And this css:
.parentt{
perspective: 100rem;
}

.shadow {
width: 75%;
padding: 10px;

background-color: #fe5fe5;
        transition: all 2s ease;
        
box-shadow: 15px 15px 40px;
  transform: rotateY(75deg);

}

.shadow:hover{
transform: rotateY(180deg);
}

body {padding: 40px;}

Actual results:

Weird shadow effect, like it's rotating on the z axis instead of the Y.
Like so:
https://ibb.co/r4Qv66Q

Expected results:

Expected result is a normal shadow. Webkit has no problem with it.

This seems to be caused by the perspective property.

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

Component: Untriaged → Web Painting
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Component: Web Painting → Graphics: WebRender
Ever confirmed: true
Summary: Perspective property makes box-shadow render incorrectly → Perspective property makes box-shadow render incorrectly (With sw-wr enabled)

cc rmader, in case we want hw-wr here instead of sw-wr.

Hi blendertut,

Can you attach the content of about:support here?

Flags: needinfo?(blendertut)
Attached file AboutSupport
[quote]

Here it is. Apparently this is caused by hardware acceleration? I indeed believe I have changed some settings in the past due to crappy nvidia drivers on linux. MIght be that?

Flags: needinfo?(blendertut)

From what I understand you should be able to update to the 470 driver series (https://www.nvidia.com/Download/driverResults.aspx/191232/en-us/ - but Ubuntu should ship it) - can you try that?

Rendering quality issue with sw-wr? Might be core webrender as well, but it looks like accelerated is rendering properly. Could you set the right Severity here Lee?

Flags: needinfo?(lsalzman)
Flags: needinfo?(lsalzman)
Severity: -- → S3

Clip tile shaders don't output the vertex W, so that SWGL can't detect if we're trying
to render something with perspective or not. swgl_drawSpan functions then get invoked
as if no perspective was used. In this case, we need to explicitly check to see if
there is perspective, or rather, that the W value varies along the span.

Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d945b8d9c2e4
Explicitly check for perspective in clip tile shaders for SWGL. r=aosmond
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Flags: qe-verify+

Reproducible on a 2022-10-14 Nightly build on macOS 12 using the testcase from Comment 2.
Verified as fixed on Firefox 108.0b3(build ID: 20221117185908) and Nightly 109.0a1(build ID: 20221117214129) on macOS 12, Ubuntu 22, Windows 10.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: