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

59 Коммитов

Автор SHA1 Сообщение Дата
Nicolas Silva 9b31d6c49b Bug 1702228 - Cache linear gradients by default. r=gw
This patch breaks linear gradients into two primitives:
 - LinearGradient is always rendered via the brush shader. It is only used with SWGL.
 - CachedLinearGradient is always rendered via a cached render task and the brush image shader. Its implementation is very similar to conic and radial gradients, with the addition of a fast-path for axis aligned gradients with two stops.

In addition the following changes are made:
 - The gradient fast path is simpler (only deals with two gradient stops).
 - Decomposing axis-aligned gradients into parts eligible for the fast path happens during scene building instead of frame building.

Differential Revision: https://phabricator.services.mozilla.com/D112018
2021-04-22 10:34:54 +00:00
Nicolas Silva 6c00b27a78 Bug 1687977 - Part 13 - Remove brush_conic_gradient. r=gw"
Differential Revision: https://phabricator.services.mozilla.com/D108801
2021-03-19 13:54:44 +00:00
Nicolas Silva 10669a3379 Bug 1687977 - Part 12 - Render conic gradients using render tasks. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D108606
2021-03-19 13:54:44 +00:00
Nicolas Silva e4e1451936 Bug 1687977 - Part 8 - Remove brush_radial_gradient. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D108468
2021-03-19 13:54:42 +00:00
Nicolas Silva 531af9689b Bug 1687977 - Part 7 - Render radial gradients using render tasks. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D108467
2021-03-19 13:54:41 +00:00
Noemi Erli 61d6f12836 Backed out 7 changesets (bug 1687977) for causing build bustages CLOSED TREE
Backed out changeset 47f20111056a (bug 1687977)
Backed out changeset 56ef057fc29c (bug 1687977)
Backed out changeset 72bcd469b597 (bug 1687977)
Backed out changeset ddceb031f73b (bug 1687977)
Backed out changeset 526d512c6cf9 (bug 1687977)
Backed out changeset 2f392cb56f71 (bug 1687977)
Backed out changeset 2865e8332baa (bug 1687977)
2021-03-19 11:52:25 +02:00
Nicolas Silva a3350cd408 Bug 1687977 - Part 13 - Remove brush_conic_gradient. r=gw"
Differential Revision: https://phabricator.services.mozilla.com/D108801
2021-03-19 09:34:28 +00:00
Nicolas Silva 04ab6dce1d Bug 1687977 - Part 12 - Render conic gradients using render tasks. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D108606
2021-03-19 09:34:28 +00:00
Nicolas Silva d42e83f212 Bug 1687977 - Part 8 - Remove brush_radial_gradient. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D108468
2021-03-19 09:34:26 +00:00
Nicolas Silva a6a203fe05 Bug 1687977 - Part 7 - Render radial gradients using render tasks. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D108467
2021-03-19 09:34:25 +00:00
Jamie Nicol 34616ad68b Bug 1507074 - Use GL_OES_EGL_image_external to render external textures. r=nical
On android video data is provided to webrender via EGL external
images. Webrender currently relies on the extension
GL_OES_EGL_image_external_essl3 to render these images. Unfortunately,
however, there are a number of devices which support GLES 3, but do
not support GL_OES_EGL_image_external_essl3.

This means we that must use the older GL_OES_EGL_image_external
(non-essl3) extension to render video on such devices. This requires
shaders to be written in ESSL1 rather than ESSL3.

Most of webrender's shaders use too many modern GLSL features to be
compatible with ESSL1. For that reason, this patch implements ESSL1
compatible variants of just the composite and cs_scale shaders, as
they are both relatively simple.

In the happy path, videos are promoted to compositor surfaces and we
simply use this new composite shader variant. In other cases, this
patch makes it so that we use a render task to perform a copy of the
video frame using the cs_scale shader, then the output of that render
task can be rendered using the regular ESSL3 TEXTURE_2D variant of
whatever shader is required. The extra copy is unfortunate, but
rewriting every shader to be ESSL1 compatible is unrealistic.

Differential Revision: https://phabricator.services.mozilla.com/D108908
2021-03-18 18:31:26 +00:00
Jamie Nicol 9413c32fff Bug 1697899 - Add fast path composite shader. r=gw
On low powered android devices it has been observed that we are GPU
bound on many pages. The composite shader, despite being relatively
simple, can account for a large proportion of these cycles due to the
large number of fragments it touches.

On Mali-T GPUs, the composite fragment shader is bound by loading the
varyings (for example, this takes 3 cycles on a Mali-T830). This patch
adds a fast path variant of the shader which removes the vColor and
vUVBounds varyings, reducing the number of cycles per fragment to 1 on
this GPU. This variant can only be used where the shader does not need
to modulate the output by a color (ie aColor is white), and when the
UV coordinates do not need to be clamped (eg because the entire
texture is being composited). Fortunately both of these conditions are
true in the common case of compositing picture cache tiles.

Differential Revision: https://phabricator.services.mozilla.com/D108686
2021-03-16 21:02:13 +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 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
Jamie Nicol 4fbbd0370b Bug 1692848 - Work around Mali driver crash caused by textureSize(samplerExternalOES). r=kvark
On some Mali devices we have encountered driver crashes caused by
calling textureSize(samplerExternalOES) in a shader without also
potentially sampling from the texture in the shader. ARM's suggested
workaround was to trick the driver in to thinking that the texture may
be sampled from (ie by sampling in a branch which is never dynamically
taken).

This is done by checking the value of a dummy uniform, and sampling
the texture if the value is non-default. Using a constant expression
did not work because the compiler would optimize the condition (and
therefore the sample) away.

Also re-enable webrender on Mali-72 and G76 devices, as it was blocked
due to this bug.

Differential Revision: https://phabricator.services.mozilla.com/D105493
2021-02-17 20:59:06 +00:00
Jeff Muizelaar 0a6b4af5e8 Bug 1690027. Avoid using texelFetchOffset on macOS. r=mstange
We've run into a number of bugs with integer comparison on macOS Intel. I
created a reduced test case of bug 1689510 here:
https://github.com/jrmuizel/texel-fetch-offset.

It appears that offset parameter to texelFetchOffset can cause subsequent uses
of that integer value to get confused and generate bad shader code.

There are known issues around texelFetchOffset on Intel mentioned in ANGLE
11e43ecee2
and https://github.com/google/angle/commit/0303cf6b95 and in mesa
4650aea7a5

My theory is that there's also a workaround in the Intel driver but this work
around is somehow broken which causes the incorrect code.

Here's the result of compilation in working case:
https://gist.github.com/jrmuizel/e6a9b838aba97ec6190c147e0aa3a335
and the broken one:
https://gist.github.com/jrmuizel/8b303770b920c44dee9a18586140ab01

The broken one has had the cmp instruction dropped.

Differential Revision: https://phabricator.services.mozilla.com/D103691
2021-02-01 17:16:19 +00:00
Glenn Watson 56e53f3baf Bug 1682365 - Pt 2 - Remove texture array usage from render task graph. r=nical
With this change, all color/alpha intermediate surfaces are individual
textures, rather than texture arrays.

This can in theory cause more batch breaks in some cases, but this
is likely to be very rare in practice.

Benefits:
 - No more allocating the array at the size of the largest task / slice.
 - Remove a source of many driver bugs on android devices.
 - Simplify integration of future patches with render task graph.

Much of the render target array texture code is still present, since
picture cache tiles in the Draw compositor still make use of texture
arrays. However, once these are switched to normal textures, we can
remove most of the slice layer, blit workaround functionality etc.

Remove the default feature setting for selecting the image sampler
kind. Instead, this must be explicitly specified by the shader or
a dynamic feature define, which makes sampler selection less error prone.

Differential Revision: https://phabricator.services.mozilla.com/D99006
2020-12-17 22:26:10 +00:00
Bogdan Tara ac1c8e039b Backed out 5 changesets (bug 1682473, bug 1682498, bug 1682465, bug 1682365) for multi-mix-blend-mode.yaml failures CLOSED TREE
Backed out changeset 0146d623031f (bug 1682498)
Backed out changeset 22981934b3e7 (bug 1682473)
Backed out changeset 46cf4dd9cbb6 (bug 1682465)
Backed out changeset 86db847cfe57 (bug 1682365)
Backed out changeset c3495de132cd (bug 1682365)
2020-12-18 00:01:49 +02:00
Glenn Watson 9cec1624e2 Bug 1682365 - Pt 2 - Remove texture array usage from render task graph. r=nical
With this change, all color/alpha intermediate surfaces are individual
textures, rather than texture arrays.

This can in theory cause more batch breaks in some cases, but this
is likely to be very rare in practice.

Benefits:
 - No more allocating the array at the size of the largest task / slice.
 - Remove a source of many driver bugs on android devices.
 - Simplify integration of future patches with render task graph.

Much of the render target array texture code is still present, since
picture cache tiles in the Draw compositor still make use of texture
arrays. However, once these are switched to normal textures, we can
remove most of the slice layer, blit workaround functionality etc.

Remove the default feature setting for selecting the image sampler
kind. Instead, this must be explicitly specified by the shader or
a dynamic feature define, which makes sampler selection less error prone.

Differential Revision: https://phabricator.services.mozilla.com/D99006
2020-12-17 19:54:02 +00:00
Ryan VanderMeulen 8654e3e18f Backed out 2 changesets (bug 1682365) for causing bug 1682566.
Backed out changeset 5589923a52c8 (bug 1682365)
Backed out changeset 0c03e3ad5e56 (bug 1682365)
2020-12-15 19:42:08 -05:00
Glenn Watson ac7ea425db Bug 1682365 - Pt 2 - Remove texture array usage from render task graph. r=nical
With this change, all color/alpha intermediate surfaces are individual
textures, rather than texture arrays.

This can in theory cause more batch breaks in some cases, but this
is likely to be very rare in practice.

Benefits:
 - No more allocating the array at the size of the largest task / slice.
 - Remove a source of many driver bugs on android devices.
 - Simplify integration of future patches with render task graph.

Much of the render target array texture code is still present, since
picture cache tiles in the Draw compositor still make use of texture
arrays. However, once these are switched to normal textures, we can
remove most of the slice layer, blit workaround functionality etc.

Remove the default feature setting for selecting the image sampler
kind. Instead, this must be explicitly specified by the shader or
a dynamic feature define, which makes sampler selection less error prone.

Differential Revision: https://phabricator.services.mozilla.com/D99006
2020-12-15 00:43:28 +00:00
Brindusan Cristian 33455e97a9 Backed out changeset 15da94c6a7b1 (bug 1682365) for wrench bustage at shadow-transforms.yaml. CLOSED TREE 2020-12-15 02:13:25 +02:00
Glenn Watson d38a041500 Bug 1682365 - Pt 2 - Remove texture array usage from render task graph. r=nical
With this change, all color/alpha intermediate surfaces are individual
textures, rather than texture arrays.

This can in theory cause more batch breaks in some cases, but this
is likely to be very rare in practice.

Benefits:
 - No more allocating the array at the size of the largest task / slice.
 - Remove a source of many driver bugs on android devices.
 - Simplify integration of future patches with render task graph.

Much of the render target array texture code is still present, since
picture cache tiles in the Draw compositor still make use of texture
arrays. However, once these are switched to normal textures, we can
remove most of the slice layer, blit workaround functionality etc.

Remove the default feature setting for selecting the image sampler
kind. Instead, this must be explicitly specified by the shader or
a dynamic feature define, which makes sampler selection less error prone.

Differential Revision: https://phabricator.services.mozilla.com/D99006
2020-12-14 21:48:41 +00:00
Glenn Watson 2ce239352c Bug 1679939 - Remove experimental PLS functionality. r=jnicol,nical
The pixel-local-storage functionality was an experiment for faster
drawing of clip masks on low end tiled GPUs. However, it's never
reached a point where it was shippable and showing clear performance
wins.

This patch removes the experimental PLS support - we can always
revive it from git history if we ever want to consider it again.

Differential Revision: https://phabricator.services.mozilla.com/D98290
2020-12-01 19:28:19 +00:00
Mihai Alexandru Michis 45708e0ef1 Merge mozilla-central to autoland a=merge
CLOSED TREE
2020-11-17 16:43:37 +02:00
Mihai Alexandru Michis 1b0d5a3a70 Backed out changeset dbcc7614b8f0 (bug 1640960) for causing rendering issues on Linux (Bug 1677728) a=backout 2020-11-17 16:40:05 +02:00
Sylvestre Ledru 0dee1b74e8 Bug 1676513 - Fix clippy warnings r=emilio,webdriver-reviewers,whimboo,rhunt
Depends on D96634

Differential Revision: https://phabricator.services.mozilla.com/D96636
2020-11-17 12:02:22 +00:00
Dzmitry Malyshau 8ffa84e50d Bug 1640960 - Support storage buffers with non-instanced rendering r=gw
This change adds a code path to avoid instancing, enabled (if supported) on non-Intel GPUs.

Side note: we still need a plan on what to do on devices that support neither of base-instance or SSBO.

Differential Revision: https://phabricator.services.mozilla.com/D87826
2020-11-17 00:10:14 +00:00
Csoregi Natalia 8cdde07a53 Backed out changeset 8d61a17c6f6e (bug 1640960) for wrench failures on shadow-transforms.yaml. CLOSED TREE 2020-11-17 01:56:30 +02:00
Dzmitry Malyshau 414eebcd57 Bug 1640960 - Support storage buffers with non-instanced rendering r=gw
This change adds a code path to avoid instancing, enabled (if supported) on non-Intel GPUs.

Side note: we still need a plan on what to do on devices that support neither of base-instance or SSBO.

Differential Revision: https://phabricator.services.mozilla.com/D87826
2020-11-16 21:58:25 +00:00
Nicolas Silva fcf924cd3f Bug 1673387 - Don't use texture arrays for shared and standalone texture cache entries. r=gw
The patch ended up more complicated than I anticipated due to a lot of places in webrender assuming texture arrays unless specified otherwise.
The patch also merges TextureTarget into ImageBufferKind, and removes the realloc code path ing the texture cache (which is supposed to be dead code since because of performance issues on windows+intel).

Differential Revision: https://phabricator.services.mozilla.com/D95562
2020-11-12 22:25:59 +00:00
Butkovits Atila bc8d4ed13b Backed out 2 changesets (bug 1673387) for bustage on gradient_cache_hardstop_clip.yaml. CLOSED TREE
Backed out changeset a315ba98577f (bug 1673387)
Backed out changeset 591c4143921f (bug 1673387)
2020-11-12 15:31:08 +02:00
Nicolas Silva 85e491c464 Bug 1673387 - Don't use texture arrays for shared and standalone texture cache entries. r=gw
The patch ended up more complicated than I anticipated due to a lot of places in webrender assuming texture arrays unless specified otherwise.
The patch also merges TextureTarget into ImageBufferKind, and removes the realloc code path ing the texture cache (which is supposed to be dead code since because of performance issues on windows+intel).

Differential Revision: https://phabricator.services.mozilla.com/D95562
2020-11-12 11:54:47 +00:00
Bogdan Tara 17e7c54035 Backed out 2 changesets (bug 1673387) for wrench/reftests/ failures CLOSED TREE DONTBUILD
Backed out changeset a755e87bf875 (bug 1673387)
Backed out changeset e4cf743d6916 (bug 1673387)
2020-11-05 20:00:08 +02:00
Nicolas Silva cf8fe5fd01 Bug 1673387 - Don't use texture arrays for shared and standalone texture cache entries. r=gw
The patch ended up more complicated than I anticipated due to a lot of places in webrender assuming texture arrays unless specified otherwise.
The patch also merges TextureTarget into ImageBufferKind, and removes the realloc code path ing the texture cache (which is supposed to be dead code since because of performance issues on windows+intel).

Differential Revision: https://phabricator.services.mozilla.com/D95562
2020-11-05 16:31:46 +00:00
Lee Salzman 7d56f4494c Bug 1623074 - add debug shaders to SWGL build. r=jrmuizel
Depends on D92909

Differential Revision: https://phabricator.services.mozilla.com/D92910
2020-10-08 13:04:39 +00:00
Nicolas Silva 6ee09103d1 Bug 1665274 - Speed up brush_opacity. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D91600
2020-10-01 13:13:30 +00:00
Matt Woodrow a7baea6b73 Bug 1658815 - Support all texture target types for the cs_scale shader. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D91370
2020-09-25 05:30:29 +00:00
Dzmitry Malyshau 6bf2ab7478 Bug 1640960 - Always sort WR shader features r=jnicol,gw
I found it hard to understand the code that builds shader features,
and even harder to modify it with a new feature. This PR refactors the shader
building code by removing the macro and introducing a FeatureList abstraction, internally.
It also sorts the features on both ends (alternatively, we could use a set).

Differential Revision: https://phabricator.services.mozilla.com/D83455
2020-07-14 15:53:31 +00:00
Dzmitry Malyshau 59b6551dd5 Bug 1638672 - Use shaders to clear texture cache regions r=geckoview-reviewers,gw,snorp
This is a suggested workaround for an interesting visual bug that we see on
some platforms with Intel Broadwell GPUs.

Also reverts https://phabricator.services.mozilla.com/D57100

Differential Revision: https://phabricator.services.mozilla.com/D78705
2020-06-08 21:05:03 +00:00
Bert Peers 49849153e7 Bug 1628175 - WebGL is drawn into the picture cache and then onto the screen r=gw
Part 1 - support RGB external surfaces for promotion to compositor
surfaces; add new shader permutations to handle all buffer kinds.
Set the promotion flag when the pixel format has no alpha, or when the
texture provider can guarantee all-solid alpha values.

Differential Revision: https://phabricator.services.mozilla.com/D71120
2020-04-30 07:08:17 +00:00
Brindusan Cristian f33d38c284 Backed out changeset 8433832c8f09 (bug 1628175) for reftest failures at 817019-1.html. CLOSED TREE 2020-04-28 21:33:46 +03:00
Bert Peers b91a3eabe0 Bug 1628175 - WebGL is drawn into the picture cache and then onto the screen r=gw
Part 1 - support RGB external surfaces for promotion to compositor
surfaces; add new shader permutations to handle all buffer kinds.
Set the promotion flag when the pixel format has no alpha, or when the
texture provider can guarantee all-solid alpha values.

Differential Revision: https://phabricator.services.mozilla.com/D71120
2020-04-27 19:38:02 +00:00
Jamie Nicol 5acad1e764 Bug 1631778 - Ensure webrender's shaders.rs is filled deterministically. r=jrmuizel
The list of pre-optimized shaders was being generated in a
non-deterministic order, causing large build time regressions. This
sort the list of shaders before writing them to the shaders.rs file.

Differential Revision: https://phabricator.services.mozilla.com/D71905
2020-04-22 13:51:13 +00:00
Lee Salzman cc83337f4b Bug 1632025 - fix SWGL shader key parsing. r=jimb
Differential Revision: https://phabricator.services.mozilla.com/D71874
2020-04-22 03:39:21 +00:00
Jamie Nicol f548e9a284 Bug 1604615 - Optimize webrender shaders at build time. r=gw
Move more shader parsing code to webrender_build, so it can be used
both at runtime and build time.

At build time optimize a set of shaders and feature flag combinations,
using glslopt. Some features are skipped because they are not
supported by the gl version, because the optimizer does not support
them, or because webrender does not need them currently.

Use build-parallel to ensure the optimization is performed in parallel
using the make jobserver. Write the optimized shader source to a
hashmap to be used at runtime, in addition to the unoptimized source.

Differential Revision: https://phabricator.services.mozilla.com/D70032
2020-04-21 10:32:03 +00:00
Lee Salzman 9cb73ab9c6 Bug 1624396 - implement centralized shader features list management for WebRender. r=gw,jrmuizel,jnicol
Differential Revision: https://phabricator.services.mozilla.com/D67958

--HG--
extra : moz-landing-system : lando
2020-03-24 22:21:25 +00:00
=?UTF-8?q?Felix=20Sch=C3=BCtt?= b9f75b4710 Bug 1621026 - Remove sha256 from dependencies r=nical
[import_pr] From https://github.com/servo/webrender/pull/3875

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

--HG--
extra : moz-landing-system : lando
2020-03-11 09:06:53 +00:00
Nicolas Silva c255d09b64 Bug 1594128 - Dynamically choose the brush kind in the shader. r=gw
This is an experiment with only image and solid to see what the infrastructure can be like.
If it works out I'll extend the it with more brush types. More work will be needed to get text rendering in there as well.

The multi-brush shader includes all brushes that it potentially needs suport for. Which brushes actually get compiled in is then specified via WR_FEATURE defines.
Since brushes can't have the same names for their entry points, they specify the function to use via a macros (WR_BRUSH_VS_FUNCTION and WR_BRUSH_FS_FUNCTION).

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

--HG--
extra : moz-landing-system : lando
2019-11-27 13:22:48 +00:00
Nicolas Silva dfceba9e8e Bug 1594128 - Only include shader sources once during parsing. r=gw
This chanes the shader parsing code to only inject #included shader sources once (the first time) if they are included multiple times.
This will allow some extra flexibility needed by the multi-brush shader.

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

--HG--
extra : moz-landing-system : lando
2019-11-27 13:22:47 +00:00