servo / webrender

A GPU-based renderer for the web
https://doc.servo.org/webrender/
Mozilla Public License 2.0
3.12k stars 276 forks source link

On my integrated GPU, a non-blurred rounded box shadow breaks all future clipping #1738

Closed mstange closed 6 years ago

mstange commented 7 years ago

https://bugzilla.mozilla.org/show_bug.cgi?id=1402073

>> Testcase <<

This testcase contains two things:

On my integrated GPU, the background is not clipped to the rounded shape.

Rendering with integrated GPU (this build already contains the != workarounds for text and gradients):

screen shot 2017-09-21 at 2 56 40 pm

Rendering with discrete GPU:

screen shot 2017-09-21 at 2 56 35 pm
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Two box shadows create garbage</title>

<style>

div {
  display: inline-block;
  margin: 10px;
  border-radius: 20px;
  width: 100px;
  height: 100px;
}

</style>

<div style="box-shadow: black 0 1px;"></div>
<div style="background: black"></div>

@glennw, any ideas where I should be searching for another integer equality comparison?

glennw commented 7 years ago

I wonder if it could be related to the for loop in the blur shader, which uses integers? Argh, what a frustrating shader compiler / driver you have!

mstange commented 7 years ago

This testcase doesn't have a blur, though.

glennw commented 7 years ago

Oh, right. Not immediately clear to me where there would be an int comparison. I'll take a quick look at the shaders today and let you know if I spot anything...

mstange commented 7 years ago

It turns out that the alternative workaround for #1809 that I gave in https://github.com/servo/webrender/pull/1810#issuecomment-334480233 actually fixes this bug. I have no idea why though.

kvark commented 7 years ago

@mstange could you make a PR then? thanks!