Skip to content

Conversation

pull[bot]
Copy link

@pull pull bot commented Jul 16, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label Jul 16, 2022
Norisz Fay and others added 29 commits March 20, 2023 09:11
…uffers r=gfx-reviewers,lsalzman

Previously, we would do a fine-grained visibility check for
prims against the dirty rect stack (after coarse grained
tile visibility), then prepare the primitive, then determine
which command buffer(s) the prim should be added to, based
on which tile(s) the prim affects.

The patch changes this so that the fine-grained visibility
check returns a list of command buffer(s) that the prim
should be added to. This is passed to the prim prepare
step, and then used to directly add prims to the buffers
rather than checking which tiles are affected by the prim.

The motivation for doing this will become apparent in
follow up patches. We want to be able to encode
multiple command buffer commands per-prim, whereas it
was previously only possible to encode primitive
commands. By allowing prim-prepare to write directly
to the command buffers, rather than return a list of
primitive commands, we can write whatever commands
are needed. Future patches will use this to write
segment rect streams, and other information.

A side effect of this is that the `tile_rect` field
in the `PrimitiveVisibility` struct is no longer
required. This reduces the size of `PrimitiveInstance`
from 104 bytes to 88 bytes, which is likely to be
a reasonable performance win on pages that have
high primitive counts.

Differential Revision: https://phabricator.services.mozilla.com/D172081

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/7631604adbf7d699e6d322fbc674af92159ec362
Sync changes from mozilla-central gfx/wr

None
Sync changes from mozilla-central gfx/wr

None
…ion. r=gfx-reviewers,lsalzman

Mali profiling tools have shown we are frequently fragment bound, in
particular due to varying interpolation. To help mitigate this, we
should use mediump where possible. Currently most of our varyings are
implicitly highp by default. This patch reduces their precision to
mediump where possible. When varyings must remain highp for
correctness reasons, this is now stated explicitly.

As expected, this does cause a fair bit of reftest fuzziness on
Android devices. This patch also updates reftest expectations to
reflect this.

Differential Revision: https://phabricator.services.mozilla.com/D173028

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/8d13c0ab66f0ac137b1461d3451ecb9361ec2d5e
…ifier. r=gfx-reviewers,lsalzman

The previous patch in this series ensured that every varying is now
given an explicit precision. We want to use mediump where possible for
performance reasons, and highp when required for correctness. Going
forward, in order to ensure that developers have considered what
precision is required for new varyings, this patch adds a shader test
to ensure that they are explicitly qualified.

Shader tests have until now used the `glsl` crate. And as the glsl
crate does not handle preprocessor directive properly, we ran them on
the pre-optimized shader sources. However, the optimization pass
outputs explicit varying precisions even if the input did not contain
them, so that does not work for this case. Instead, we have switched
to use the`glsl-lang` crate, which does handle preprocessor directives
correctly. This does add some duplicate crate dependencies, however
this only affects wrench, not webrender itself.

Differential Revision: https://phabricator.services.mozilla.com/D173029

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/c365f3dc09e9db939a8c52842caea494d9e5fdef
…on't have async deltas applies. r=hiro,gw

When a new scene is swapped in on the render backend thread, its
scroll frames have scroll offsets that come from the main thread
and do not reflect async scroll deltas until such deltas are
sampled from APZ.

It's possible for hit-testing to observe the scene in this
temporary state, potentially leading to incorrect hit-test results.

To avoid this, save the async offsets from the previous scene
and apply them to the new scene until we can sample proper offsets
from APZ.

Differential Revision: https://phabricator.services.mozilla.com/D173100

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/22e24605023566e5dcaaf5dd7b86b3faeff27b51
…wers,lsalzman

No functionality change here, just preparing for having different
variations of shaders that make use of ps_quad as a base.

Differential Revision: https://phabricator.services.mozilla.com/D172197

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/13d410908d8b2da5cdbc5f79fac63de24734360d
…on't have async deltas applies. r=hiro,gw

When a new scene is swapped in on the render backend thread, its
scroll frames have scroll offsets that come from the main thread
and do not reflect async scroll deltas until such deltas are
sampled from APZ.

It's possible for hit-testing to observe the scene in this
temporary state, potentially leading to incorrect hit-test results.

To avoid this, save the async offsets from the previous scene
and apply them to the new scene until we can sample proper offsets
from APZ.

Differential Revision: https://phabricator.services.mozilla.com/D173100

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/5ac55813344e623494328d5b42fe8faf78225057
…gfx-reviewers,jnicol

When upgrading the NDK to r23, the wrench builds for android fail
because cargo apk starts adding flags to the cargo rustc call it does,
and that's not compatible with the wrench crate having both a lib and a
bin target.

As cargo apk only packages the lib in the apk, we can just be explicit
and build the library only.

Differential Revision: https://phabricator.services.mozilla.com/D173244

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/ea4b6f8be5642f0cbf79b2ae6c4e8359fa93fe40
Sync changes from mozilla-central gfx/wr

None
In bug 1823411 prim_shared.glsl's vClipMaskUv was made mediump,
assuming it was safe to do so as it is an unnormalized texture
coordinate. This is, however, causing fuzziness in a test on Adreno
devices, so we are now reverting it to highp.

Differential Revision: https://phabricator.services.mozilla.com/D173468

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/9dd24249fabe8af5c5b8941c3d064c985e903181
Sync changes from mozilla-central gfx/wr

None
…dering path r=gfx-reviewers,lsalzman

At the same time, simplify the inner region support from arbitrary
tile configs to an inner + AA edge section setup. It turns out that
we won't need the extra tiling functionality in follow up patches.

Differential Revision: https://phabricator.services.mozilla.com/D172749

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/b6f5e0e3f9d867140e7a82bfac9f86aff27982fd
Sync changes from mozilla-central gfx/wr

None
… control the processing of ResultMsg messages r=gfx-reviewers,lsalzman

It is a preparation for Bug 1804233. From bug 1776885 comment 6, we need to defer WebRender rendering on render thread if remote texture is not ready. To do it, ResultMsg messages handling needs to be controlled.

By adding the followings, ResultMsg messages handling could be controlled by RenderThread.
-  FramePublishId to new_frame_ready()
-  Renderer::set_target_frame_publish_id()

new_frame_ready() has frame_publish_id. The publish_id could be set to Renderer::set_target_frame_publish_id(). Then Renderer::update() defers processing of ResultMsg, if frame_publish_id of ResultMsg::PublishDocument exceeds target_frame_publish_id.

Differential Revision: https://phabricator.services.mozilla.com/D173512

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/27ea6388b268aac783a32c2cf2f414e00115e61b
Sync changes from mozilla-central gfx/wr

None
Sync changes from mozilla-central gfx/wr

None
…i-T devices. r=gfx-reviewers,lsalzman

Since landing bug 1823411 we have been receiving crash reports on a
variety of Mali-T devices when attempting to compile the brush_blend
shader. This appears to be due to changing v_color_mat to mediump,
though the reason why that crashes is currently unknown. This patch
reverts it to highp to avoid the crash.

This is being landed as-is due to being so late in the cycle, in order
to prevent crashes making it to beta. Further work should be to
determine precisely what conditions cause the crash, and add a test to
ensure we do not encounter it again.

Differential Revision: https://phabricator.services.mozilla.com/D174722

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/88039c2ec5138a0185cfdd5260adefe078e55a0f
Sync changes from mozilla-central gfx/wr

None
This adds the new infrastructure for rendering masked primitives
and uses it for simple rectangle primitives. Follow up patches
will port other primitives to it (and transformed rectangles).

Instead of rendering an alpha mask and then applying that during
picture cache rendering of content, the underlying content is
drawn to an off-screen surface, and the mask is applied on
top of that via multiplicative blending.

This is particularly helpful for applying masks to dynamically
rendered pictures in future, as we can apply the mask over the
already rendered picture without allocating an extra surface.

Since the content and mask is rendered together to a surface,
we can take advantage of this in future by caching the result
in the texture cache, rather than a temporary render target.
This means we don't need to redraw clip masks for this content
each time the surrounding area is invalidated.

Since the clip-mask is rendered in to the off-screen surface,
it is cheaper and simpler to composite the content in to the
main scene, avoiding an extra texture fetch and some tricky
fragment shader logic to sample the correct part of the mask.

To reduce the number of off-screen pixels that get drawn, the
system supports splitting the content up in to a series of
segments. This can either be a 9-patch, for the simple and
common case of a single rounded clip, or a tile grid across
the primitive. The tile grid can make it much faster to apply
large image masks, where there are often large areas that we
can determine are not affected by the mask image.

Differential Revision: https://phabricator.services.mozilla.com/D173095

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/4548910a12b0f695022c17c1fc005c51fdb3ecd7
Sync changes from mozilla-central gfx/wr

None
cpeterso and others added 28 commits February 22, 2024 09:29
Sync changes from mozilla-central gfx/wr

None
This shouldn't need to run in the branch that merely mirrors upstream.
A failing CI should block the mirror.
…-reviewers,lsalzman

This allows extending render task indices to 32 bits without
requiring an increase in the vertex / instance size.

Differential Revision: https://phabricator.services.mozilla.com/D202526

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/b9f2c3f5a805a94fdebf367e5e0bdb964074a3e7
- Increase the border of the rectangles rendered for the APZ minimap.
 - Alter the order in which the minimap rectangles are drawn, such that the
   larger rects are drawn first.

Differential Revision: https://phabricator.services.mozilla.com/D198203

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/b393aaa0e4618b62dc5f2d2c1376610beedb39c1
…ewers,lsalzman

It's no longer used now that the quad-based image mask code
is stable and used everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D202889

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/a1e06392575fdfdb7677edec1f9e5bf07f3610a9
…ers,gw

See:
 - https://github.com/rust-lang/rfcs/blob/master/text/3373-avoid-nonlocal-definitions-in-fns.md
 - https://doc.rust-lang.org/reference/items/constant-items.html#unnamed-constant

Peek-poke generate code that will likely be rejected by a future version of rust: implementation of traits inside an expression (the const in our case) that is visible outside of the expression. Fortunately there is an exception for unnamed consts (likely because of the existing ecosystem of macros that declare items in anonymous dummy consts to scope thinsg like imports). So this PR replaced the dummy _DERIVE_peek_poke_FOR_??? const with an unnamed one.

Differential Revision: https://phabricator.services.mozilla.com/D202715

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/08141e744d45bfe826834e52bf84fdd8fb921eb9
… does not get overridden by pref. r=gfx-reviewers,lsalzman

Batched texture uploads are supposed to be hard-coded as enabled or
disabled on certain platforms, and on other platforms controllable via
a pref. However, a previous refactoring made it so that the hard-coded
value is always being overridden by the pref (by checking whether the
hard-coded value is set in the wrong place). As a consequence, batched
texture uploads have been disabled on Mali-G devices, resulting in
poor performance.

This patch moves the check to the correct place, meaning the
hard-coded value is respected once again.

Differential Revision: https://phabricator.services.mozilla.com/D203145

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/aaed3db903c2afdf8b5c6df0d93dac6cddf72a37
…halves during low-quality pinch zoom. r=gw

When low-quality-pinch-zoom is enabled we avoid updating the raster
scale whilst a zoom is active, in order to avoid expensive
re-rasterizations. As a result, however, zooming out a very long
way (ie from fully zoomed in to fully zoomed out) causes a huge number
of picture cache tiles to be on screen at once. Allocating this number
of textures causes extremely bad jank and potentially even OOM
crashes.

Additionally, when zooming in a very long way content appears very
blurry.

To avoid this, this patch updates the raster scale during a
low-quality pinch zoom whenever the zoom has doubled or halved since
the raster scale was last updated. This avoids the blurriness as well
as limiting the number of tiles on screen at once. This comes at the
cost of the occasional expensive frame when everything is
re-rasterized, but is a worthwhile trade-off.

Differential Revision: https://phabricator.services.mozilla.com/D203287

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/67fc55f308fa669b7cf75ff8504145ddf41934a8
…lzman

It is unexpected since adjust_mask_scale_for_max_size rounds the rectangle out but asserting it caused crash spikes (see bug 1882416). This patch will discard the primitive or segment instead of attempting to allocate an invalid mask. If this causes some popping, we'll get some context in the logs.

Differential Revision: https://phabricator.services.mozilla.com/D202944

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/561de3241ca525c5fe2ec20dbc7bb7cc2eda5d23
…oming. r=gw

When updating the SpatialTree we record whether each spatial node is
itself or any of its ancestors are actively async zooming. This allows
us to make certain optimizations, such as low-quality pinch zoom mode,
or rounding the raster scale for glyphs.

The current implementation of this, however, contains a bug which
means that a node's is_ancestor_or_self_zooming variable will only be
true when itself or its _direct_ ancestor are zooming, rather than
_any_ ancestor. On certain pages this means we are unable to make the
aforementioned optimizations, resulting in poor performance. This
patch rectifies this problem and adds a unit test.

Differential Revision: https://phabricator.services.mozilla.com/D203446

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/ce04bfaf8a42c978750bbc90600639374bf1293a
…or Gecko r=jrmuizel

Make glean an optional dependency that is only enabled when building
WebRender for Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D204059

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/10af6b2ff03bd7512d53f3ed02f7e83dba7c57ba
@mrobinson mrobinson deleted the branch Mattlk13:master March 15, 2024 09:33
@mrobinson mrobinson deleted the master branch March 15, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.