3075 Commits

Author SHA1 Message Date
Iulian Moraru
04448c5245 Backed out changeset fdfd26e1439d (bug 1738700) for causing reftest failures on 1738700-1.html. CLOSED TREE 2021-11-05 03:20:42 +02:00
Glenn Watson
8af0ab58e4 Bug 1730695 - Fix panic when casting large value to i32 rect r=gfx-reviewers,bradwerth,nical,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D128122
2021-11-04 19:44:32 +00:00
Jonathan Kew
7593e1dd90 Bug 1738700 - Don't use FT_LOAD_COLOR for COLR-format fonts within WebRender, because color-font layers are handled at the Gecko level. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D130271
2021-11-04 13:30:16 +00:00
Nicolas Silva
51efadfa3e Bug 1737648 - Don't batch uploads for items larger than a certain size. r=gfx-reviewers,bradwerth
The default size on most platforms is 256*256 which corresponds to the default blob tile size. I didn't check on android so I set it to 512*512 above which we never batch the upload so that the behavior is unchanged, but I suspect that a smaller threshold like 256*256 would also work better there.

On Windows with heavy blob image workloads, not batching gives a 20%-30% improvement to the time spent in update_texture_cache.

Differential Revision: https://phabricator.services.mozilla.com/D129516
2021-11-03 16:42:42 +00:00
Jeff Muizelaar
1cb365fed3 Bug 1738909 - Use upstream CFData::from_arc instead of raw bindings. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D130173
2021-11-03 13:28:59 +00:00
Sandor Molnar
b1852a9b5e Backed out changeset ea6696688123 (bug 1738909) for causing build bustages. CLOSED TREE 2021-11-02 21:56:00 +02:00
Jeff Muizelaar
85c2c5cb36 Bug 1738909 - Use upstream CFData::from_arc instead of raw bindings. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D130173
2021-11-02 19:23:36 +00:00
Jonathan Kew
1e487abed0 Bug 1738137 - Refactor new_ct_font_with_variations for better clarity. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D129732
2021-11-02 11:46:36 +00:00
Sandor Molnar
970c07a3b8 Backed out changeset 042a934005b6 (bug 1696842) for causing bug 1738241. CLOSED TREE 2021-10-28 22:54:33 +03:00
Glenn Watson
b4c34b5218 Bug 1737948 - Store primitive instances in a single array r=gfx-reviewers,bradwerth
Previously, each PrimitiveList within a Picture primitive contained
an array of PrimitiveInstance structs. This makes it hard for the
primitives to be accessed unless during a recursive picture tree
traversal.

In future, we want multiple subsystems to be able to store an index
buffer of primitives (for example, the animation property binding
system will store primitives that need to be invalidated when the
attached animation value changes). The tile-cache primitive
dependencies are currently stored in an index buffer, but after
this change can be unified so that the dependency information can
be stored with the primitive instance.

An additional benefit of this change is that we can now flatten the
visibility, prepare passes for better memory access patterns and
code simplicity.

Differential Revision: https://phabricator.services.mozilla.com/D129596
2021-10-28 03:22:47 +00:00
Glenn Watson
2975f937b4 Bug 1738141 - Add extra debug logging for duplicate spatial node keys r=gfx-reviewers,jrmuizel
Log duplicate keys to try and track down an intermittent / rare
failure that cannot be reproduced locally.

Differential Revision: https://phabricator.services.mozilla.com/D129735
2021-10-27 23:22:27 +00:00
Jonathan Kew
731e590e63 Bug 1732629 followup, refresh Cargo.lock in wrench. a=wrench-fix CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D129661
2021-10-27 14:37:40 +00:00
Jonathan Kew
395d683a98 Bug 1732629 - [gfx/wr] Fix new_ct_font_with_variations to use non-localized variation axis names from Core Graphics. r=jrmuizel CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D129636

Depends on D129576
2021-10-27 14:15:19 +00:00
Butkovits Atila
1f01e97274 Backed out 2 changesets (bug 1732629) for causing build bustages. CLOSED TREE
Backed out changeset d67d7024d557 (bug 1732629)
Backed out changeset 59cc3481c534 (bug 1732629)
2021-10-27 16:55:53 +03:00
Jonathan Kew
f00db61f80 Bug 1732629 - [gfx/wr] Fix new_ct_font_with_variations to use non-localized variation axis names from Core Graphics. r=jrmuizel
Depends on D129576

Differential Revision: https://phabricator.services.mozilla.com/D129636
2021-10-27 13:35:05 +00:00
Glenn Watson
3be5315167 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/D117954
2021-10-25 20:22:12 +00:00
Ryan VanderMeulen
2f0a7946a8 Backed out changeset 0ef9b28ae108 (bug 1733154) to hopefully resolve the hangs reported in bug 1734958. 2021-10-22 14:06:59 -04:00
Ryan VanderMeulen
9111fc1dba Backed out changeset 45eeed639240 (bug 1734958) 2021-10-22 14:06:38 -04:00
Nicolas Silva
127a09cc61 Bug 1711477 - Use a dedicated shader for copying from a texture to another. r=gfx-reviewers,kvark
Using the composite shader for that was very clunky. It might even be faster thanks to how much simpler the shader is and it's use of texel fetch instead of linear sampling.

Differential Revision: https://phabricator.services.mozilla.com/D128256
2021-10-21 08:54:51 +00:00
Nicolas Silva
617736e4be Bug 1711477 - Improve the texture cache eviction heuristics. r=gfx-reviewers,kvark.
The previous heuristics would set a threshold in number of allocated bytes per texture type, continuously evict a fixed number of items above the threshold and stop evicting below the threshold.

The new logic lowers the amount of allocated bytes below which we stop evicting, and make eviction above the threshold more progressive, only evicting very cold items if the the cache pressure is low and ramping up how aggressively items a are evicted along with the cache pressure.
In addition, we maintain a minimum of cache pressure until there is a only a single texture atlas allocated for a given shared texture type.

The above combined with the texture cache compaction code ensures that even after a difficult workload, the texture cache eventually settles back to a single texture atlas per type with reasonable fragmentation.

Differential Revision: https://phabricator.services.mozilla.com/D128255
2021-10-21 08:54:51 +00:00
Nicolas Silva
3410a14bae Bug 1711477 - Texture cache compaction r=gfx-reviewers,kvark
Differential Revision: https://phabricator.services.mozilla.com/D128254
2021-10-21 08:54:50 +00:00
Nicolas Silva
5cb683cc8f Bug 1711477 - Add support for copying from a cache texture to another. r=gfx-reviewers,kvark
The initial implementation uses the composite shader just like the upload code, but it's a bit messy. I'll add a simpler more specialized shader for that in a followup.

Differential Revision: https://phabricator.services.mozilla.com/D128253
2021-10-21 08:54:50 +00:00
Nicolas Silva
fce170afcb Bug 1711477 - Add a way to get from atlas alloc ID to texture cache handle. r=gfx-reviewers,gw
This will be used in a followup patch to defragment the texture cache.

Differential Revision: https://phabricator.services.mozilla.com/D128252
2021-10-21 08:54:49 +00:00
Nicolas Silva
fea049f963 Bug 1711477 - Update etagere to 0.2.6. r=gfx-reviewers,jrmuizel
The newer version contains a few new APIs that will be needed for texture cache compaction:
 - An iterator of allocated items.
 - A way to associate AllocIds with a stable index.

Differential Revision: https://phabricator.services.mozilla.com/D128251
2021-10-21 08:54:49 +00:00
Mike Hommey
f9a7b0aeb4 Bug 1736484 - Fix new dead-code warnings with rust 1.57. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D128825
2021-10-20 02:05:57 +00:00
Butkovits Atila
0b9cb325a6 Backed out changeset b8815353a549 (bug 1736484) for causing wrench failures. CLOSED TREE 2021-10-20 04:17:44 +03:00
Mike Hommey
fcd6e6f3ae Bug 1736484 - Fix new dead-code warnings with rust 1.57. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D128825
2021-10-20 00:13:12 +00:00
Miko Mynttinen
b8f0f4f1f2 Bug 1735677 - Remove bogus write_bytes in strip_red_zone r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D128626
2021-10-15 18:37:08 +00:00
Glenn Watson
fbba30b287 Bug 1734740 - Retain spatial tree across display lists r=gfx-reviewers,nical
With this change, the spatial tree is no longer rebuilt
every time a new display arrives and a scene is built.

Instead, scene building maintains a hash map of spatial
node keys <-> indices, allowing any spatial node that
has been recently seen in a display list to be retained.

Scene building then checks if the node is equivalent or
has been modified since the last display list, and sends
these delta changes as part of the scene swap to the
frame building code. The frame building code applies
the deltas to each updated spatial node.

The primary benefits of this are:
 - Spatial node indices are now stable across display lists,
   allowing future interning of primitives and clips to
   include the spatial node. This can be used for various
   optimizations, including interning during DL building,
   caching transform state, reducing size of PrimitiveInstance

 - Frame building now knows exactly which spatial nodes are
   new, removed, updated or unchanged. We can make this of
   this to cache a lot of the (mostly) redundant calculations
   that are done during both scene and frame building.

Differential Revision: https://phabricator.services.mozilla.com/D127902
2021-10-13 20:39:41 +00:00
Nicolas Silva
30d83a76ab Bug 1734958 - Don't spin forever trying to get gl errors. r=gfx-reviewers,jnicol
I should have known better than to expect that all drivers would implement a queue correctly.

Differential Revision: https://phabricator.services.mozilla.com/D128385
2021-10-13 16:09:17 +00:00
Glenn Watson
601f48038d Bug 1734346 - Support backdrops with simple rounded-rect clip cases. r=gfx-reviewers,nical
This allows picture slice backdrops to be supported when they contain
rounded-rect clip(s) that are in the same coordinate system as the
primitive. This is the common case, and allows subpixel AA to be
used in bookmark menu and other popups that are part of the current
Gecko UI.

Differential Revision: https://phabricator.services.mozilla.com/D128156
2021-10-12 23:38:23 +00:00
Marian-Vasile Laza
b59ea8ad55 Backed out changeset 95eeb31a4edd (bug 1730695) for causing crashtest failures on 1730695.html. CLOSED TREE 2021-10-12 04:18:58 +03:00
Glenn Watson
47eaf635b3 Bug 1730695 - Fix panic when casting large value to i32 rect r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D128122
2021-10-11 21:44:01 +00:00
Narcis Beleuzu
d87e50b393 Backed out changeset 5cc276dd61cc (bug 1734740) for bc failures on browser_bug1563629.js CLOSED TREE 2021-10-12 01:06:23 +03:00
Glenn Watson
d08327c72e Bug 1734740 - Retain spatial tree across display lists r=gfx-reviewers,nical
With this change, the spatial tree is no longer rebuilt
every time a new display arrives and a scene is built.

Instead, scene building maintains a hash map of spatial
node keys <-> indices, allowing any spatial node that
has been recently seen in a display list to be retained.

Scene building then checks if the node is equivalent or
has been modified since the last display list, and sends
these delta changes as part of the scene swap to the
frame building code. The frame building code applies
the deltas to each updated spatial node.

The primary benefits of this are:
 - Spatial node indices are now stable across display lists,
   allowing future interning of primitives and clips to
   include the spatial node. This can be used for various
   optimizations, including interning during DL building,
   caching transform state, reducing size of PrimitiveInstance

 - Frame building now knows exactly which spatial nodes are
   new, removed, updated or unchanged. We can make this of
   this to cache a lot of the (mostly) redundant calculations
   that are done during both scene and frame building.

Differential Revision: https://phabricator.services.mozilla.com/D127902
2021-10-11 20:32:40 +00:00
Jamie Nicol
8f218bf44c Bug 1734815 - Fix component transfer filters in brush_blend on Adreno 3xx. r=gfx-reviewers,nical
Due to driver bugs, component transfer filters using brush_blend do
not currently work on some Adreno 3xx devices.

The first issue is that the values for which function to use for each
component (the "v_funcs" varying) appear to be incorrect in the
fragment shader. Previously we passed these values as an int[4], but
due to this requiring to many varying slots we changed this to an
ivec4. This broke the entire shader for all blend operations on this
device (bug 1731758), so we recently changed to bit packing the 4
values in to a single int. This fixed the rest of the blend ops, but
component transfer still didn't work. This patch switches to using a
vec4, casting the values to and from floats, which works correctly.

The second issue appears to be due to converting between integer
precisions. The component transfer functions require a texelFetch from
the GPU cache. The fetch_from_gpu_cache* functions accept a highp int
argument, as GPU cache addresses can exceed those represenatable with
a mediump int. brush_blend is currently using a mediump int (the
default fragment shader precision) for the table_address, which is
therefore incorrect. However, the shader is buggy even when the actual
value is representable with mediump, indicating a driver bug to do
with precision conversion, rather than the value overflowing. To avoid
this we must make the table_address varying and variables highp (as
they should be anyway), but additionally must make the "k" and
"offset" variables (which get added to the table address) highp too.

Depends on D128049

Differential Revision: https://phabricator.services.mozilla.com/D128050
2021-10-11 12:04:53 +00:00
Jamie Nicol
56e7e392aa Bug 1730458 - Work around driver bugs in cs_border_segment on Adreno 3xx. r=gfx-reviewers,nical
Due to a driver bug, cs_border_segment renders incorrectly on some
Adreno 3xx devices. The problem lies with the "ivec4 vConfig" varying,
whose values appear to be incorrect in the fragment shader. I have
attempted splitting these all in to separate varyings, removing the
bit packing for style and edge_axis, and using unsigned uvecs, each of
which solved some issues but not all.

The only workaround which appeared to fix all of the problems was
using floating point vecs rather than ivecs, and casting the values to
and from floats. This means that we need two components each for style
and edge_axis (as we cannot use bitwise operations with floats), so
they are packed in a vec4. The segment and clip_mode must therefore be
packed in a separate vec2. This patch implements this workaround.

It certainly seems as if the Adreno driver has serious issues using
integer (or ivec) varyings, however it is not as simple as them never
working correctly. For that reason I have, for now, resisted
converting all integer varyings in all shaders to floats. If we
encounter more similar issues in the future it may be worthwhile doing
so (and adding a test to ensure we do not reintroduce them).

Differential Revision: https://phabricator.services.mozilla.com/D128049
2021-10-11 12:04:53 +00:00
Nazım Can Altınova
24958e3147 Bug 1733335 - Change the ProfilerHooks trait to use str instead of CStr r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D127114
2021-10-11 07:59:10 +00:00
Nicolas Silva
96e83a80cc Bug 1690619 - Fix typos in the RenderReasons profiler integration. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D127811
2021-10-08 12:33:14 +00:00
Glenn Watson
e8b6ea1147 Bug 1734474 - Refactor spatial tree invertible calculations r=gfx-reviewers,kvark
With this change, we no longer have mutable state stored inside
the `ReferenceFrameInfo` struct, which will be important as we
introduce the follow up patches to retain the spatial tree
between display lists.

Differential Revision: https://phabricator.services.mozilla.com/D127726
2021-10-06 23:32:51 +00:00
Sandor Molnar
ac87f8501e Backed out 4 changesets (bug 1733335) for causing multiple dt failures. CLOSED TREE
Backed out changeset 8c14ac28d042 (bug 1733335)
Backed out changeset 066819ce0e86 (bug 1733335)
Backed out changeset c44e1bb6d9ff (bug 1733335)
Backed out changeset 4cd1efb42295 (bug 1733335)
2021-10-06 17:49:47 +03:00
Nazım Can Altınova
cf54135177 Bug 1733335 - Change the ProfilerHooks trait to use str instead of CStr r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D127114
2021-10-06 11:35:16 +00:00
Glenn Watson
a9ef6ad97d Bug 1734282 - Remove some unused scroll frame APIs and code r=gfx-reviewers,jrmuizel
ScrollSensitivity is not used by Gecko. Also remove some remnants
of the old code to combine scroll frames when display lists swap.

Differential Revision: https://phabricator.services.mozilla.com/D127609
2021-10-06 06:43:03 +00:00
Glenn Watson
41785a2204 Bug 1734280 - Remove pipeline_id from hit-test API r=gfx-reviewers,jrmuizel
The ability to restrict hit-tests by pipeline_id isn't used by
Gecko or wrench. Remove it to simplify landing some of the upcoming
spatial tree work.

Differential Revision: https://phabricator.services.mozilla.com/D127608
2021-10-06 03:59:16 +00:00
Mike Hommey
d9a281a906 Bug 1709274 - Upgrade osmesa-src to current trunk. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D127602
2021-10-06 03:54:04 +00:00
Nicolas Silva
cb6ac0df62 Bug 1690619 - Keep track of where the request to rendering something comes from. r=gfx-reviewers,mstange
This patch adds plumbing to keep track of why we request frames to be rendered.
This information is then displayed in gecko profile markers on the renderer thread as well as in profiler HUD counters (See "Render reasons" in profiler.rs).

Differential Revision: https://phabricator.services.mozilla.com/D127274
2021-10-05 12:54:39 +00:00
Marian-Vasile Laza
6c22452994 Backed out 4 changesets (bug 1733335) for causing build bustages. CLOSED TREE
Backed out changeset 45a3ae02f837 (bug 1733335)
Backed out changeset 41c62acfb5a6 (bug 1733335)
Backed out changeset cf3b6b6cc6c6 (bug 1733335)
Backed out changeset b919d9cfb8e5 (bug 1733335)
2021-10-05 15:07:44 +03:00
Nazım Can Altınova
eaea89985c Bug 1733335 - Change the ProfilerHooks trait to use str instead of CStr r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D127114
2021-10-05 11:34:27 +00:00
Glenn Watson
7538eca3ed Bug 1733290 - Add scaffolding for retained spatial tree r=gfx-reviewers,nical
This patch makes the SceneSpatialTree be retained by the scene
Document structure, and the SpatialTree be retained by the
RenderBackend structure.

This is exactly the same structure as the interning system uses:
 - The SceneSpatialTree is mutated as a new scene is built
 - A set of "deltas" is calculated and stored in SpatialTreeUpdates
 - The SpatialTreeUpdates are stored in a BuiltTransaction
 - The SpatialTreeUpdates are applied to the SpatialTree on scene swap

For now, the "deltas" are simply a complete list of spatial nodes,
which retains existing behavior. In future, this will contain actual
deltas, based on the unique spatial node keys that now exist.

Also update the capture/replay functionality to (de)serialize both
the retained scene and frame versions of the spatial tree.

Differential Revision: https://phabricator.services.mozilla.com/D127021
2021-10-05 01:25:27 +00:00
Glenn Watson
41fd1abba4 Bug 1733030 - Remove preserve_frame_state functionality r=gfx-reviewers,nical
It's not needed by Gecko, and complicates work in progress to
retain the spatial tree across display lists.

Differential Revision: https://phabricator.services.mozilla.com/D126863
2021-10-04 20:14:04 +00:00