Граф коммитов

2019 Коммитов

Автор SHA1 Сообщение Дата
Glenn Watson c5357efe52 Bug 1697346 - Remove snapping of inflated surface rects. r=aosmond,gfx-reviewers
When an offscreen surface establishes a raster root, this code
was causing incorrect snapping / rounded (even on non-inflated
surfaces), resulting in test failures in some cases.

In theory, this should not be necessary, since scroll offsets are
snapped, and primitives are already snapped during scene building.
Additionally, the picture surface allocation code expects surfaces
with fractional offsets and handles this case (by rounding out the
allocation size, and creating a UV set that samples from the subpixel
offsets of the surface).

In practice, there may be content that relies on this which isn't
tested by CI, so let's land this as a separate patch and see if it
causes any real-world content regressions, before landing the
changes that rely on this.

Differential Revision: https://phabricator.services.mozilla.com/D107768
2021-03-11 02:30:34 +00:00
Dorel Luca 55df31935a Backed out changeset 7647c3e90bed (bug 1697346) for Wrench failure. CLOSED TREE 2021-03-11 03:11:29 +02:00
Glenn Watson cd53f382d8 Bug 1697346 - Remove snapping of inflated surface rects. r=aosmond,gfx-reviewers
When an offscreen surface establishes a raster root, this code
was causing incorrect snapping / rounded (even on non-inflated
surfaces), resulting in test failures in some cases.

In theory, this should not be necessary, since scroll offsets are
snapped, and primitives are already snapped during scene building.
Additionally, the picture surface allocation code expects surfaces
with fractional offsets and handles this case (by rounding out the
allocation size, and creating a UV set that samples from the subpixel
offsets of the surface).

In practice, there may be content that relies on this which isn't
tested by CI, so let's land this as a separate patch and see if it
causes any real-world content regressions, before landing the
changes that rely on this.

Differential Revision: https://phabricator.services.mozilla.com/D107768
2021-03-11 00:45:21 +00:00
Jim Blandy 62aca759f4 Bug 1697085: Fix heuristic comparison in webrender::batch::BatchRects. r=nical
BatchRects would like to avoid allocating and iterating over detailed rectangle
lists when the bounding box is not much larger than the area of the detailed
rectangle lists, such that the approximation won't affect the accuracy of
intersection queries. But bounding boxes can badly overestimate intersections,
so sometimes a detailed list must be retained.

Thus, the heuristic in `add_rect` should start a detailed rectangle list when
the area of the old BB and the new rectangle is *less* than that of the new BB,
not more.

Differential Revision: https://phabricator.services.mozilla.com/D107696
2021-03-10 21:22:37 +00:00
Jim Blandy ce7105394a Bug 1697320: Mark webrender::render_task_graph::dump_render_tasks_as_svg as needed only when 'capture' feature is enabled r=nical
Differential Revision: https://phabricator.services.mozilla.com/D107748
2021-03-10 21:21:23 +00:00
Dorel Luca 02c5114cb2 Backed out changeset af65c3578782 (bug 1696842) as requested by dev. CLOSED TREE 2021-03-10 22:25:07 +02:00
Nicolas Silva f1e0f8285a Bug 1687977 - Part 4 - Move FastLinearGradientTask into gradient/linear.rs r=gw
In the spirit of keeping primitive-specific logic mostly in the same place, this moves the linear gradient render task and the code to convert it into a gpu-visible instance into linear.rs.

I'm planning to give all specific render task structures/logic the same treatment eventually.

Differential Revision: https://phabricator.services.mozilla.com/D107676
2021-03-10 09:58:08 +00:00
Nicolas Silva 6c4581b9f3 Bug 1687977 - Part 3 - rename gradient into fast_linear_gradient in various places. r=gw
Historically WebRender's code has used 'gradient' as a shorthand for 'linear gradient' and often more specifically for 'the fast path for linear gradients'. This patch makes the naming less ambiguous in particular in places where we'll see more types of gradients sid by side introduced by upcoming patches in this series.

Differential Revision: https://phabricator.services.mozilla.com/D107642
2021-03-10 09:58:08 +00:00
Nicolas Silva dc4f3e9012 Bug 1687977 - Part 2 - Split prim_store/gradient.rs into sub-modules. r=gw
prim_store/gradient.rs is large enough that splitting it up will make things a bit clearer. The new organization is:
 - prim_store/gradient/mod.rs: shared/gradient-agnostic code.
 - prim_store/gradient/<linear|radial|conic>.rs: specific gradient code.

In addition, various gradient-specific data structures currently living in other modules will move into the proper gradient modules as part of this patch series.

For convenience, all specific public symbols are reexported in prim_store::gradient.

Differential Revision: https://phabricator.services.mozilla.com/D107641
2021-03-10 09:58:08 +00:00
Nicolas Silva 6a61762567 Bug 1687977 - Part 1 - Rename cs_gradient into cs_fast_linear_gradient. r=gw
It is the cs_* shader used to cache linear gradients in the simple/fast path (more complex linear gradients are rendered with a brush shader. The goal of this patch series is to move all gradients to cached render tasks that will be composited with brush_image, so there will be a cs_linear_gradient introduced in a followup to cover the general case as well as cs_radial_gradient and cs_conic_gradient to replace the brush equivalents.

Differential Revision: https://phabricator.services.mozilla.com/D107640
2021-03-10 09:58:07 +00:00
Nicolas Silva 1066800f50 Bug 1697187 - Print the shader when encountering glslopt errors. r=jnicol
glslopt error messages typically look like:

314(15): error: syntax error, unexpected NEW_IDENTIFIER, expecting ',' or ';'

Which would be fine if we had a way to see what is at line 314, however we don't store the concatenated shader string on disk so it's a bit hard to guess where in the source a typo led to a an unknown identifier.

This patch makes the build script print the shader source with line numbers when glslopt throws an error.

Differential Revision: https://phabricator.services.mozilla.com/D107655
2021-03-10 07:42:33 +00:00
Glenn Watson b6d27eceff Bug 1696842 - Establish raster roots for more picture composite modes. r=gfx-reviewers,lsalzman
Add MixBlend and ComponentTransfer to the picture composite modes that
unconditionally establish a raster root.

All the known bugs with the raster root code have been fixed, so let's
start incrementally enabling raster roots for more picture modes, and
fix any regressions that come from these before making raster roots
the default for all surfaces.

Differential Revision: https://phabricator.services.mozilla.com/D107405
2021-03-09 20:05:47 +00:00
Lee Salzman e52a1dd3a0 Bug 1696439 - Fix corner apex distance calculation in cs_clip_rectangle. r=jrmuizel
This fixes a bug wherein we were calculating the distance to the corner apex incorrectly
which could result in it being clipped in the presence of transforms that cause the step
scale to not be axis-aligned.

Differential Revision: https://phabricator.services.mozilla.com/D107618
2021-03-09 19:08:09 +00:00
Lee Salzman 7390f42dc3 Bug 1687157 - Support 24-bit depth in SWGL. r=jrmuizel
It is possible to support 24-bit depth in SWGL without a large performance hit
and without increasing the size of the depth buffer. Since depth runs already
have 32-bit entries, if we carefully limit the depth run size to 8 bits we have
24 bits left over to store the actual depth value.

Differential Revision: https://phabricator.services.mozilla.com/D107409
2021-03-09 02:01:26 +00:00
Nicolas Silva 72ea81b9fb Bug 1695908 - Fix the render task graph SVG dump. r=gw
During the frame graph refactoring, a new Pass type was introduced which holds the render task ids for a given pass (before we attribute the task ids to sepcific sub-passes of RenderPass). As a result, the tasks vector of RenderPass which the SVG dumps reads is now unused and always empty.

This patch removes the unused tasks vector and fix the svg dump so that it reads from the Pass struct instead.

Differential Revision: https://phabricator.services.mozilla.com/D106945
2021-03-08 10:02:48 +00:00
Glenn Watson 6d8e45d3ff Bug 1696301 - Tiled clip masks can be incorrectly culled on scaled raster root surfaces. r=gfx-reviewers,bradwerth
The check for which tiles of a clip mask need to be drawn was using
the surface device pixel ratio to calculate a true device position
for the tile. In most cases, this works fine.

However if the device pixel ratio of a surface is different to the
global device pixel ratio (e.g. due to a scale factor being applied
on a surface that establishes a raster root), then the calculations
are incorrect and can result in skipping clip mask tiles that do
need to be rendered for correctness.

Differential Revision: https://phabricator.services.mozilla.com/D107167
2021-03-07 21:46:18 +00:00
Jeff Muizelaar a7a3f7d10e Bug 1696464 - Disable the profiling wrapper on non-ARM. r=kvark
It was dominating profiles on my gen4.5 system.

Differential Revision: https://phabricator.services.mozilla.com/D107240
2021-03-05 02:24:23 +00:00
Lee Salzman 21640ca40f Bug 1695405 - Remove texture array support from SWGL. r=nical
Since WebRender doesn't need texture array support anymore, neither does SWGL.
This is a massive simplification which should benefit both performance and
simplicity. This patch pretty much just removes functionality but doesn't
change any functionality that is already used and relied upon.

Differential Revision: https://phabricator.services.mozilla.com/D106718
2021-03-04 04:43:23 +00:00
Glenn Watson fceee43490 Bug 1696089 - Clip chains can incorrectly propagate to inner primitives in some cases. r=gfx-reviewers,kvark,bradwerth
Fix a bug that can occur when:
 - Parent stacking context is considered redundant
 - Parent stacking context has a transform
 - Parent stacking context establishes a raster root
 - Parent stacking context has a clip
 - Child stacking context has a filter (or other feature requiring a surface)

In these cases, the clips would be incorrectly propagated to the
primitives inside the child stacking context, instead of applied
to the child stacking context surface itself. This can cause correctness
issues when raster roots are established, and potential performance
issues if raster roots are not established.

Differential Revision: https://phabricator.services.mozilla.com/D107024
2021-03-03 22:51:37 +00:00
Jamie Nicol 3e85fea00a Bug 1694707 - Select correct scroll root within fixed position items with dynamic toolbar. r=gw
Currently when selecting the scroll root for picture caching, if a
non-Zoom transform is encountered we give up and select the root
spatial node. This is because the transform may be non-axis aligned.

When the Fenix dynamic toolbar is enabled, fixed position items must
create a spatial node with an animated transform, so that they can be
positioned asynchronously by APZ when the toolbar moves.

The combination of these two things means for that scroll frames
within fixed position items we always select the root spatial node,
meaning that the entire contents invalidates continuously while
scrolling.

To fix this, add a flag to the Transform ReferenceFrameKind which
marks the transform as always being a 2D scale or translation. When
selecting the scroll root, we can continue searching through such
reference frames, as we already do for Zoom frames. Set this flag true
for references frames created due to the dynamic toolbar.
Additionally, assert that the transform is indeed a 2d scale or
translation after it is resolved.

The condition of the transform being only a 2d scale and translation
is shared with ReferenceFrameKind::Zoom, so that has been removed and
its uses updated to use this new flag instead. An additional
should_snap flag has also been added, so that we continue to snap zoom
transforms, and additionally snap the dynamic-toolbar related
transforms too.

Lastly, this adds some unit tests for find_scroll_root.

Differential Revision: https://phabricator.services.mozilla.com/D106809
2021-03-02 21:53:41 +00:00
Glenn Watson 45a519bee0 Bug 1695804 - Prevent picture cache composite modes from being raster roots. r=nical
Add an explicit match on picture composite mode, forcing tile caches
to never be raster roots, and add a test that fails if a tile cache
is marked as a raster root.

Follow ups to this patch will incrementally move more composite modes
to be raster roots, allowing us to fix up any regressions without
switching everything to be a raster root at once.

Differential Revision: https://phabricator.services.mozilla.com/D106859
2021-03-02 20:01:21 +00:00
Cosmin Sabou 065d53dec9 Backed out changeset dec00fcb9bea (bug 1695804) for causing wrench bustages. CLOSED TREE 2021-03-02 23:08:48 +02:00
Glenn Watson 86c5e992c7 Bug 1695804 - Prevent picture cache composite modes from being raster roots. r=nical
Add an explicit match on picture composite mode, forcing tile caches
to never be raster roots, and add a test that fails if a tile cache
is marked as a raster root.

Follow ups to this patch will incrementally move more composite modes
to be raster roots, allowing us to fix up any regressions without
switching everything to be a raster root at once.

Differential Revision: https://phabricator.services.mozilla.com/D106859
2021-03-02 20:01:21 +00:00
Nicolas Silva 98671a2fc3 Bug 1695660 - Remove supports_blit_to_texture_array. r=gfx-reviewers,jrmuizel
Depends on D106798

Differential Revision: https://phabricator.services.mozilla.com/D106799
2021-03-02 16:54:22 +00:00
Nicolas Silva 8d862267dd Bug 1695660 - Remove texture layers from copy_texture_sub_region. r=gfx-reviewers,jrmuizel
Depends on D106797

Differential Revision: https://phabricator.services.mozilla.com/D106798
2021-03-02 16:54:22 +00:00
Nicolas Silva 83c0cc8556 Bug 1695660 - Remove layer parameter from DrawTarget and ReadTarget. r=gfx-reviewers,jrmuizel
Depends on D106796

Differential Revision: https://phabricator.services.mozilla.com/D106797
2021-03-02 16:54:21 +00:00
Nicolas Silva bdcb564f48 Bug 1695660 - Remove fbos per layer in Texture. r=gfx-reviewers,jrmuizel
Depends on D106795

Differential Revision: https://phabricator.services.mozilla.com/D106796
2021-03-02 16:54:21 +00:00
Nicolas Silva 1c5bda72d8 Bug 1695660 - Remove layer index parameter from the upload code. r=gfx-reviewers,jrmuizel
Depends on D106794

Differential Revision: https://phabricator.services.mozilla.com/D106795
2021-03-02 16:54:21 +00:00
Nicolas Silva d93533a412 Bug 1695660 - Remove layer_id parameter in attach_read_texture. r=gfx-reviewers,jrmuizel
Depends on D106793

Differential Revision: https://phabricator.services.mozilla.com/D106794
2021-03-02 16:54:20 +00:00
Nicolas Silva 8b70e81783 Bug 1695660 - Remove TEXTURE_2D_ARRAY code paths. r=gfx-reviewers,jrmuizel
Depends on D106792

Differential Revision: https://phabricator.services.mozilla.com/D106793
2021-03-02 16:54:20 +00:00
Nicolas Silva 277d82993b Bug 1673939 - Remove Device::max_texture_layers. r=gfx-reviewers,jrmuizel
Depends on D106791

Differential Revision: https://phabricator.services.mozilla.com/D106792
2021-03-02 16:54:19 +00:00
Nicolas Silva c29513541a Bug 1673939 - Remove a few more texture array-related symbols and fix some comments. r=gfx-reviewers,jrmuizel
Depends on D106790

Differential Revision: https://phabricator.services.mozilla.com/D106791
2021-03-02 16:54:19 +00:00
Nicolas Silva 1806302ad1 Bug 1695660 - Remove texture layer support from frame captures and Renderer::clear_texture. r=gfx-reviewers,jrmuizel
Depends on D106789

Differential Revision: https://phabricator.services.mozilla.com/D106790
2021-03-02 16:54:19 +00:00
Nicolas Silva fcfbe99c73 Bug 1695660 - Remove texture layer support from the texture cache debug view. r=gfx-reviewers,jrmuizel
Depends on D106788

Differential Revision: https://phabricator.services.mozilla.com/D106789
2021-03-02 16:54:18 +00:00
Nicolas Silva afc634aae7 Bug 1695660 - Remove layer_count member in Texture. r=gfx-reviewers,jrmuizel
Depends on D106787

Differential Revision: https://phabricator.services.mozilla.com/D106788
2021-03-02 16:54:18 +00:00
Nicolas Silva 471085f192 Bug 1695660 - Remove layer count parameter from create_texture. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D106787
2021-03-02 16:54:17 +00:00
Lee Salzman 6488599ba1 Bug 1695807 - Mix blend image brush data should be RasterizationSpace::Screen. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D106880
2021-03-02 12:18:22 +00:00
Mihai Alexandru Michis b840f0be3a Backed out changeset 140002ffa867 (bug 1695807) for causing reftest failures.
CLOSED TREE
2021-03-02 13:20:11 +02:00
Lee Salzman 02463068b6 Bug 1695807 - Mix blend image brush data should be RasterizationSpace::Screen. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D106880
2021-03-02 08:33:03 +00:00
Jamie Nicol 226a216318 Bug 1658205 - Don't sample APZ post webrender scene build. r=botond,nical
Conceptually we should only sample APZ on frame build, never on scene
build. When a late scene build occured, this unnecessary sample was
the underlying cause of the non-monotonic sample times as seen in bug
1653796. The fix for bug 1653796 introduced non-vsync-aligned sample
times to work around this, but these lead to inconsistent scroll
deltas during fling animations, appearing as janky scrolling on
Android.

This patch fixes the underling issue, by removing the sample after
scene building. This means we no longer hit the case where sample
times are in the past after a late scene build, allowing us to revert
bug 1653796 to ensure that sample times remain vsync-aligned.

Differential Revision: https://phabricator.services.mozilla.com/D106414
2021-03-01 09:00:00 +00:00
Glenn Watson 296101d5a6 Bug 1694982 - Fix mix-blend backdrop sampling from scrolled + clipped picture caches. r=nical
The calculation of the available backdrop rect was incorrect in the
case of a picture cache slice that is both scrolled and also clipped
by long content which is affected by the mix-blend-mode.

Differential Revision: https://phabricator.services.mozilla.com/D106572
2021-02-28 20:05:53 +00:00
Lee Salzman cf4a050155 Bug 1682194 - Accelerate cs_clip_rectangle in SWGL. r=jrmuizel
cs_clip_rectangle is slow because we evaluate distance AA for every fragment
the shader touches. With SWGL, we can do much better since we have control
over span. We calculate an inner opaque octagon which can just use a cheap
solid fill and an outer AA octagon within which we need to actually we do
AA and outside which we can just do another solid clear. This reduces most
of the cost of rounded-rectangles to just some setup work, a few fragments
of distance AA on the ends of a span, and large runs of solid color where
we don't have to do much work.

Differential Revision: https://phabricator.services.mozilla.com/D106658
2021-02-27 11:26:30 +00:00
Nicolas Silva 80bc5f0c1b Bug 1694909 - Part 12 - Remove the need to wrap uvs in a vec3 in shaders. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D106510
2021-02-26 14:54:18 +00:00
Nicolas Silva 75a406eaaa Bug 1694909 - Part 11 - Remove texture array shader variations. r=gw
A small patch but probably the most impactful of this series as it removes a whole lot of generated shaders.

Differential Revision: https://phabricator.services.mozilla.com/D106509
2021-02-26 14:54:18 +00:00
Nicolas Silva ab19851395 Bug 1694909 - Part 10 - Remove ImageBufferKind::Texture2DArray. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D106508
2021-02-26 14:54:18 +00:00
Nicolas Silva fe203350ef Bug 1694909 - Part 9 - Remove layer from ImageSource. r=gw
Also rename the shader's ImageResource into ImageSource to match the terminology on the rust side (especially since the rust code has a different thing named ImageResource).

Differential Revision: https://phabricator.services.mozilla.com/D106484
2021-02-26 14:54:17 +00:00
Nicolas Silva 3bdd0ac816 Bug 1694909 - Part 8 - Remove most remaining usage of layer index in the shaders. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D106483
2021-02-26 14:54:17 +00:00
Nicolas Silva f998e2063e Bug 1694909 - Part 7 - Store RenderTaskData's user data as a vec4. r=gw
This replaces the vec3 with a vec4.

Differential Revision: https://phabricator.services.mozilla.com/D106482
2021-02-26 14:54:16 +00:00
Nicolas Silva c358947209 Bug 1694909 - Part 6 - Remove the layer index from render task struct in the shaders. r=gw
Remove RenderTaskCommonData in the process and replace it with RectWithSize directly.

Differential Revision: https://phabricator.services.mozilla.com/D106481
2021-02-26 14:54:16 +00:00
Nicolas Silva 12bc395575 Bug 1694909 - Part 5 - Remove layer parameter from draw_texture_cache_target. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D106480
2021-02-26 14:54:16 +00:00