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

93 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey 5318c99194 Bug 1742749 - Allow unused Scope::name. r=bustage-fix CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D132757
2021-12-03 00:33:12 +00:00
Lee Salzman 327a74e75a Bug 1689978 - Fill out-of-bounds texelFetchPtr with zeroes rather than clamping. r=jrmuizel
Attempting to just clamping the base address returning from texelFetchPtr might be causing
some crashes in the case the texture is actually smaller than the offset area. Instead, switch
out the sampler with a zero buffer to ensure we have something sane to sample without having
to do slow bounds checking on everything.

Differential Revision: https://phabricator.services.mozilla.com/D132508
2021-12-01 08:24:06 +00:00
Lee Salzman aac91caa52 Bug 1728659 - Output struct field names for single-component swizzles in glsl-to-cxx. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D124254
2021-09-01 21:34:04 +00:00
Jeff Gilbert afdbf9538b Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
  references'.

Differential Revision: https://phabricator.services.mozilla.com/D115298
2021-06-25 19:16:22 +00:00
Iulian Moraru 1a8cb02555 Backed out changeset 10a229d128c0 (bug 1459526) for causing reftest failures on short.mp4.lastframe.html. CLOSED TREE 2021-06-25 06:34:36 +03:00
Jeff Gilbert 5c14187731 Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
  references'.

Differential Revision: https://phabricator.services.mozilla.com/D115298
2021-06-24 23:43:31 +00:00
Alexandru Michis 3477ca89c8 Backed out changeset f7016db57a2e (bug 1459526) for causing reftest failures.
CLOSED TREE
2021-06-18 07:49:06 +03:00
Jeff Gilbert 920429087b Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
  references'.

Differential Revision: https://phabricator.services.mozilla.com/D115298
2021-06-17 23:43:34 +00:00
Butkovits Atila 367d829107 Backed out changeset 318f32313091 (bug 1459526) for causing wrench bustages. CLOSED TREE 2021-06-17 04:45:11 +03:00
Jeff Gilbert 72024fcc23 Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
  references'.

Differential Revision: https://phabricator.services.mozilla.com/D115298
2021-06-17 01:12:18 +00:00
Lee Salzman 28af07fd90 Bug 1700434 - Add SWGL fast-path for ps_text_run. r=jrmuizel
This adds some swgl_commitTextureLinearR8ToRGBA8 variations so that we can deal
with alpha glyph formats. Following that, a simple span shader is added that
dispatches to this as appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D115551
2021-05-21 06:52:12 +00:00
Lee Salzman f09a90ffdf Bug 1700434 - Implement gl_ClipDistance support in SWGL. r=jrmuizel
This implements gl_ClipDistance so that the text shader doesn't have
to manually evaluate whether or not we're inside the untransformed
source texture. This simplification is necessary so that we can work
towards using swgl_commitTexture in the text shader.

Differential Revision: https://phabricator.services.mozilla.com/D115457
2021-05-21 06:52:12 +00:00
Lee Salzman f9e08d3c30 Bug 1700434 - Implement faster subpixel text blend mode for SWGL. r=jrmuizel
This adds a swgl_blendSubpixelText() extension that enables us to move some
of the complexity of plumbing dual-source blending out of the shader for
subpixel text. This will enable further speed-ups later by allowing us to use
swgl_commitTexture.

Differential Revision: https://phabricator.services.mozilla.com/D115456
2021-05-21 06:52:11 +00:00
Iulian Moraru 7fcb0d2a66 Backed out 4 changesets (bug 1700434) for causing bustages in src/glsl.h. CLOSED TREE
Backed out changeset 215ea9dc277b (bug 1700434)
Backed out changeset 64f8b849e94e (bug 1700434)
Backed out changeset 6643c36ec306 (bug 1700434)
Backed out changeset a998658f3364 (bug 1700434)
2021-05-21 09:37:17 +03:00
Lee Salzman acd20a15d5 Bug 1700434 - Add SWGL fast-path for ps_text_run. r=jrmuizel
This adds some swgl_commitTextureLinearR8ToRGBA8 variations so that we can deal
with alpha glyph formats. Following that, a simple span shader is added that
dispatches to this as appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D115551
2021-05-21 05:53:46 +00:00
Lee Salzman 5b6a4ecbe1 Bug 1700434 - Implement gl_ClipDistance support in SWGL. r=jrmuizel
This implements gl_ClipDistance so that the text shader doesn't have
to manually evaluate whether or not we're inside the untransformed
source texture. This simplification is necessary so that we can work
towards using swgl_commitTexture in the text shader.

Differential Revision: https://phabricator.services.mozilla.com/D115457
2021-05-21 05:53:45 +00:00
Lee Salzman d1796d3a33 Bug 1700434 - Implement faster subpixel text blend mode for SWGL. r=jrmuizel
This adds a swgl_blendSubpixelText() extension that enables us to move some
of the complexity of plumbing dual-source blending out of the shader for
subpixel text. This will enable further speed-ups later by allowing us to use
swgl_commitTexture.

Differential Revision: https://phabricator.services.mozilla.com/D115456
2021-05-21 05:53:45 +00:00
Alexandru Michis 1c4e911bb6 Backed out 4 changesets (bug 1700434) for causing bustages in src/glsl.h
CLOSED TREE

Backed out changeset 78cc8dd9ed2a (bug 1700434)
Backed out changeset eb02c32b173e (bug 1700434)
Backed out changeset 9d932ee247a2 (bug 1700434)
Backed out changeset 5ff6e9101b77 (bug 1700434)
2021-05-21 08:36:57 +03:00
Lee Salzman 0eabbb9d61 Bug 1700434 - Add SWGL fast-path for ps_text_run. r=jrmuizel
This adds some swgl_commitTextureLinearR8ToRGBA8 variations so that we can deal
with alpha glyph formats. Following that, a simple span shader is added that
dispatches to this as appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D115551
2021-05-21 04:54:31 +00:00
Lee Salzman 71d671d43e Bug 1700434 - Implement gl_ClipDistance support in SWGL. r=jrmuizel
This implements gl_ClipDistance so that the text shader doesn't have
to manually evaluate whether or not we're inside the untransformed
source texture. This simplification is necessary so that we can work
towards using swgl_commitTexture in the text shader.

Differential Revision: https://phabricator.services.mozilla.com/D115457
2021-05-21 04:54:30 +00:00
Lee Salzman 107eef0d62 Bug 1700434 - Implement faster subpixel text blend mode for SWGL. r=jrmuizel
This adds a swgl_blendSubpixelText() extension that enables us to move some
of the complexity of plumbing dual-source blending out of the shader for
subpixel text. This will enable further speed-ups later by allowing us to use
swgl_commitTexture.

Differential Revision: https://phabricator.services.mozilla.com/D115456
2021-05-21 04:54:29 +00:00
Jeff Muizelaar 94cd5cfe14 Bug 1711538 - Improve 'compatible_type()' r=lsalzman
This renames compatible_type() to can_implicitly_convert_to()
which is a better name. The parameters are renamed to make
it more obvious what's going on. A note is added about
glsl misparsing of float literals and finally, implicit conversion of
float/double to int is removed because that's not supported by glsl.

Differential Revision: https://phabricator.services.mozilla.com/D115247
2021-05-17 20:52:38 +00:00
Lee Salzman 7a5a451f96 Bug 1674396 - Implement SWGL fast-path for box shadows. r=jrmuizel
This adds a span shader that tries to treat the box shadow as a nine-patch
and intersect with the various sectors of it. This allows committing entire
contiguous spans of texture from the source box shadow rather than doing
slower per-fragment processing.

Differential Revision: https://phabricator.services.mozilla.com/D115113
2021-05-17 17:43:39 +00:00
Lee Salzman 7a0649e83c Bug 1703402 - Clamp RGB components after YUV conversion for SWGL blending. r=jrmuizel
This expands on an earlier fix from bug 1698009. It turns out we can occasionally find
YUV values which can still produce negative RGB values if only Y is clamped. The final
solution to this is just to clamp the output RGB values rather than input YUV values.

Since this is only used when we fall off the SWGL fast-paths (which properly handle
this clamping already), the performance impact of the extra clamping should be negligible.

Differential Revision: https://phabricator.services.mozilla.com/D111032
2021-04-07 01:25:34 +00:00
Lee Salzman f68ef51657 Bug 1703069 - Fix set_uniform_4fv loading. r=jrmuizel
We were just generating nonsensical code for this case. I don't
think this actually gets used anywhere so we never noticed.

Differential Revision: https://phabricator.services.mozilla.com/D110832
2021-04-05 18:19:46 +00:00
Lee Salzman 1c2fb23c5c Bug 1700206 - Support tile repeat limits in SWGL. r=jrmuizel
Sometimes we sample slightly outside the tile repeat boundaries due to rounding
or anti-aliasing, which may cause potential sampling artifacts along primitive
edges. This adds supports for enforcing tile repeat limits as we otherwise do
in the brush_image shader to prevent such artifacts.

Differential Revision: https://phabricator.services.mozilla.com/D110397
2021-03-31 20:13:16 +00:00
Jamie Nicol 07f8f9ce16 Bug 1695912 - Ensure shaders use 16 or fewer varying vectors even if driver does not pack them. r=jrmuizel
On some Adreno 3xx devices we have observed that the driver does not
pack varyings in to vectors as efficiently as the spec mandates. This
results in some of our shaders using a greater number of varying
vectors than GL_MAX_VARYING_VECTORS (which 16 on this device), leading
to shader compilation errors at run time.

Work around this by manually packing our varyings in to fewer
vectors. Additionally, add a test to ensure that we never use more
than 16 vectors even if the driver were to perform no additional
packing.

Differential Revision: https://phabricator.services.mozilla.com/D107929
2021-03-12 11:10:47 +00:00
Noemi Erli 491c8096b5 Backed out changeset 2171d982acdf (bug 1695912) for causinf wrench failures CLOSED TREE 2021-03-11 22:17:34 +02:00
Jamie Nicol ba18d9627d Bug 1695912 - Ensure shaders use 16 or fewer varying vectors even if driver does not pack them. r=jrmuizel
On some Adreno 3xx devices we have observed that the driver does not
pack varyings in to vectors as efficiently as the spec mandates. This
results in some of our shaders using a greater number of varying
vectors than GL_MAX_VARYING_VECTORS (which 16 on this device), leading
to shader compilation errors at run time.

Work around this by manually packing our varyings in to fewer
vectors. Additionally, add a test to ensure that we never use more
than 16 vectors even if the driver were to perform no additional
packing.

Differential Revision: https://phabricator.services.mozilla.com/D107929
2021-03-11 15:07:40 +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
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
Lee Salzman e2f1115dc4 Bug 1694196 - Document swgl_drawSpanRGBA8/R8. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D106014
2021-02-22 21:07:26 +00:00
smolnar ddcaebfbd0 Backed out changeset fc222543876b (bug 1694196) for causing webrender lint failure. CLOSED TREE 2021-02-22 22:44:37 +02:00
Lee Salzman 3334d30f14 Bug 1694196 - Document swgl_drawSpanRGBA8/R8. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D106014
2021-02-22 19:58:46 +00:00
Lee Salzman b2e764a5fc Bug 1694165 - Override SWGL blend mode for drop shadows. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D105981
2021-02-22 19:58:15 +00:00
Lee Salzman 38845a4afa Bug 1686244 - Accelerate nearest repeat filtering in SWGL. r=jrmuizel
Some sites use pixelated/crisp image-rendering and/or 1x1 images as color
sources. When we hit these, we fall off the fast-path. Try to handle some
of those cases we are finding in the wild, namely nearest filtering and
repeat filtering.

There is some slight movement in the wrench fuzz due to the composite shader
being accelerated in situations it was previously not due to nearest filter.

Differential Revision: https://phabricator.services.mozilla.com/D105864
2021-02-22 04:14:39 +00:00
Lee Salzman 7d3755c3f6 Bug 1686244 - Accelerate radial gradients in SWGL. r=jrmuizel
The same optimization of looking for merged linear gradients can also be
applied to radial gradients by solving the quadratic equation to check
how large a span we can process within a given merged span. This allows
us to save a bunch of table lookup and some other math in the inner loops.

Differential Revision: https://phabricator.services.mozilla.com/D105858
2021-02-22 04:14:39 +00:00
Lee Salzman 6d46022aa7 Bug 1686244 - Accelerate linear gradients in SWGL. r=jrmuizel
For linear gradients, we are currently bottlenecked by looking up a gradient
table entry, doing interpolation, and converting to pixel formats for every
sample.

We can accelerate this by instead looking for contiguous segments of gradient
within the range of entries we need to sample and then interpolating these
as a single gradient. This also enables us to convert to relevant pixel formats
only when setting up this gradient, which greatly reduces the per-pixel processing
down to essentially a shift and add.

To enable this sort of crawling of the gradient table, the output gradients have
been modified such that each entry's step value will equal an adjacent entry's
step value if and only if they are from same gradient. We can ensure this by, in
the very rare case two segments of gradient have the same step, using the equivalent
of nextafter() to imperceptibly alter the value so that the invariant is maintained.

Differential Revision: https://phabricator.services.mozilla.com/D105716
2021-02-22 04:14:38 +00:00
Lee Salzman 15e2d003ce Bug 1678119 - Simplify SWGL image fast-paths since complex blending is no longer required. r=jrmuizel
Now that most of the complicated alpha-pass features such as clip-masking and anti-aliasing
are handled in SWGL during the blend stage, most of the fast-paths are identical and only call
swgl_commitTextureLinear in a tight loop. We can do a lot better here by just moving that loop
into SWGL, not only making it faster but removing all the redundant boiler-plate code out of
the shaders.

Differential Revision: https://phabricator.services.mozilla.com/D104536
2021-02-12 02:43:56 +00:00
Lee Salzman d91d4d18d4 Bug 1678119 - Implement native anti-aliasing in SWGL. r=jrmuizel
The main goal of this patch is to move all the complexity of optionally
handling anti-aliasing out of the GLSL drawSpan fast-paths and into SWGL
itself into specific blend-mode handling of anti-aliasing. Mainly this
adds a swgl_antiAlias() extension to be called from the GLSL vertex shader,
after which no further involvement is necessary from the shader to work.
This also enables SWGL to better track those areas of a span that don't
need any anti-aliasing applied, and so can potentially be faster.

Some massaging of blend_pixels() was necessary to get it to inline properly
with all the extra cases added. This is mainly a consequence of the DO_AA
macro that lives inside BLEND_CASE, which is used to handle the dispatching
of new AA_BLEND_KEY and AA_MASK_BLEND_KEY cases. The parameters for these
AA modes are mostly handled in SWGL via the aa_span() function, which computes
the area of the span where non-opaque AA weights are necessary and where it can
skip over the opaque interior.

There are some incidental drive-by cleanups that were necessary of bvecs and
pack_pixels.

Differential Revision: https://phabricator.services.mozilla.com/D104492
2021-02-12 02:43:54 +00:00
Butkovits Atila 9852a9e53e Backed out 4 changesets (bug 1678119) for causing build bustage on brush_blend.h. CLOSED TREE
Backed out changeset c93691df2440 (bug 1678119)
Backed out changeset 163ea6e7bcc2 (bug 1678119)
Backed out changeset 16b232a35692 (bug 1678119)
Backed out changeset b9dce9d33351 (bug 1678119)
2021-02-12 03:32:07 +02:00
Lee Salzman 9c94c67c13 Bug 1678119 - Simplify SWGL image fast-paths since complex blending is no longer required. r=jrmuizel
Now that most of the complicated alpha-pass features such as clip-masking and anti-aliasing
are handled in SWGL during the blend stage, most of the fast-paths are identical and only call
swgl_commitTextureLinear in a tight loop. We can do a lot better here by just moving that loop
into SWGL, not only making it faster but removing all the redundant boiler-plate code out of
the shaders.

Differential Revision: https://phabricator.services.mozilla.com/D104536
2021-02-12 00:19:03 +00:00
Lee Salzman 2044de5687 Bug 1678119 - Implement native anti-aliasing in SWGL. r=jrmuizel
The main goal of this patch is to move all the complexity of optionally
handling anti-aliasing out of the GLSL drawSpan fast-paths and into SWGL
itself into specific blend-mode handling of anti-aliasing. Mainly this
adds a swgl_antiAlias() extension to be called from the GLSL vertex shader,
after which no further involvement is necessary from the shader to work.
This also enables SWGL to better track those areas of a span that don't
need any anti-aliasing applied, and so can potentially be faster.

Some massaging of blend_pixels() was necessary to get it to inline properly
with all the extra cases added. This is mainly a consequence of the DO_AA
macro that lives inside BLEND_CASE, which is used to handle the dispatching
of new AA_BLEND_KEY and AA_MASK_BLEND_KEY cases. The parameters for these
AA modes are mostly handled in SWGL via the aa_span() function, which computes
the area of the span where non-opaque AA weights are necessary and where it can
skip over the opaque interior.

There are some incidental drive-by cleanups that were necessary of bvecs and
pack_pixels.

Differential Revision: https://phabricator.services.mozilla.com/D104492
2021-02-12 00:19:02 +00:00
Lee Salzman 28c09d8dcd Bug 1691139 - Use cheaper linear approximation for WR shader anti-aliasing. r=gw
Differential Revision: https://phabricator.services.mozilla.com/D104270
2021-02-07 20:15:47 +00:00
Lee Salzman 2cdca4441a Bug 1690967 - remove some calls to commit_span. r=bradwerth
This removes some calls to commit_span from inside the draw_span specializers.
Instead it relies upon the span rasterizer loop to do some of the work, which
will incur a function pointer call in the rare case we actually return out
of a specializer early. This shouldn't be that performance critical and will
remove some inliner bloat.

Also, I refactored commit_output in the rasterizer itself to hopefully cause
fewer template instantiations which should also further reduce inliner bloat.

Differential Revision: https://phabricator.services.mozilla.com/D104150
2021-02-05 20:37:20 +00:00
Lee Salzman 900774169e Bug 1690886 - Support 4-component swizzles in SWGL. r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D104098
2021-02-04 21:50:36 +00:00
Lee Salzman 73e9582ee4 Bug 1674524 - implement KHR_blend_equation_advanced in SWGL. r=bradwerth
This patch has a few moving parts. We have to first tell WR that when it
detects the extension that it is actually allowed to use it. We have to make
the glsl-to-cxx translator eat the blend_supports_all_equations layout
qualifier. We have to enable generation of advanced-blend-equation variants
in the SWGL build setup. Then we report the actual extension inside SWGL.
Finally, we actually add all the necessary blend equation enums, hash them
down to a blend key, and implement all the blend modes therein.

Differential Revision: https://phabricator.services.mozilla.com/D103804
2021-02-02 22:18:21 +00:00
Brindusan Cristian d3b8616aad Backed out changeset f71aafc4e845 (bug 1674524) for build bustages in src/gl.cc. CLOSED TREE 2021-02-03 00:07:59 +02:00
Lee Salzman 7b87580cdf Bug 1674524 - implement KHR_blend_equation_advanced in SWGL. r=bradwerth
This patch has a few moving parts. We have to first tell WR that when it
detects the extension that it is actually allowed to use it. We have to make
the glsl-to-cxx translator eat the blend_supports_all_equations layout
qualifier. We have to enable generation of advanced-blend-equation variants
in the SWGL build setup. Then we report the actual extension inside SWGL.
Finally, we actually add all the necessary blend equation enums, hash them
down to a blend key, and implement all the blend modes therein.

Differential Revision: https://phabricator.services.mozilla.com/D103804
2021-02-02 21:43:12 +00:00
Lee Salzman 8b4b32c5c1 Bug 1675590 - implement provisional fast-paths for linear and radial gradients. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D103136
2021-01-27 06:00:15 +00:00