Commit Graph

52245 Commits

Author SHA1 Message Date
skia-recreate-skps
e4bc70cff5 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: I14812380e30fea326f480c6a6785f4a425e7f52f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337457
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-11-22 06:51:19 +00:00
skia-recreate-skps
dd612b6a92 Update Go Deps
Change-Id: I039247e7d3ede716f106b8155486f4f4da024068
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337382
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-11-22 05:48:50 +00:00
Mike Klein
ee40ec6dd6 remove Op::pack
pack(x,y,bits) as an alias for x|(y<<bits) only existed originally to
implement it with the SLI arm64 instruction, but I've since realized
that was misguided.

I had thought the assumption on pack ("(x & (y << bits)) == 0"), i.e.
"no overlap between x and the shifted y", was enough to make using SLI
legal, but it's actually not strong enough a requirement.

The SLI docs say "...inserts the result into the corresponding vector
element in the destination SIMD&FP register such that the new zero bits
created by the shift are not inserted but retain their existing value."
The key thing not mentioned there happens with zero bits _not_ created
by the shift, the ones already present at the top of y.  They're of
course inserted, overwriting any previous values.

This means SLI (and so pack()) become strictly order dependent in a way
I had never intended.  This will work as you'd think,

    skvm::I32 px = splat(0);
    px = pack(px, r,  0);
    px = pack(px, a, 24);

but this version swapping the two calls to pack() will overwrite alpha,

    skvm::I32 px = splat(0);
    px = pack(px, a, 24);
    px = pack(px, r,  0);

I find that error-prone, so I've removed Op::pack and replaced it
with a simple expansion to x|(y<<bits).  That of course works in either
order.

This new test can't JIT at head, but if we implement the other missing
instructions (soon, dependent CL) it would start failing when JIT'd.
The interpreter and x86 were both fine, since they're both doing what's
now the only approach to pack(), the simple x|(y<<bits).

I've left assembler support for SLI in case we want to try it again.

Change-Id: Iaf879309d3e1d0a458a688f3a62556e55ab05e23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337197
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-11-21 12:38:19 +00:00
Herb Derby
d90024d498 split subrun API into Blob and Op interfaces
Instead of using sub classing to generate the atlas API, give
the atlas portion its own interface. Then the atlas subrun
variants can subclass both interfaces.

Change-Id: I8a0ca3d19bd362877224fa64f6c49a5f50d0ceb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336958
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-21 02:24:07 +00:00
Mike Reed
a03f8bf837 other ways to organize samplingoptions?
do not land

Change-Id: I5fa7b2a0d1eb7e893d9b333f850a2f515d7ce065
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336956
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-21 02:00:26 +00:00
Robert Phillips
797831c3aa Reland "Hook up ShaderErrorHandler in the Metal backend."
This reverts commit 0758da2c60.

Reason for revert: A different CL was causing the iOS failures

Original change's description:
> Revert "Hook up ShaderErrorHandler in the Metal backend."
>
> This reverts commit 69df532a55.
>
> Reason for revert: See if this is causing the iOS redness on our tree
>
> Original change's description:
> > Hook up ShaderErrorHandler in the Metal backend.
> >
> > Also cleans up dumping of shader code to use GrShaderUtils.
> >
> > Change-Id: I4d2a13e1a54284d7da0242b74cebb3900921fc35
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337077
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=jvanverth@google.com,brianosman@google.com
>
> Change-Id: I34125bd560cfbd12e50c732137cf921067457be2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337184
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=jvanverth@google.com,robertphillips@google.com,brianosman@google.com

# Not skipping CQ checks because this is a reland.

Change-Id: I46c9d4356702b44c75bb416ae6e8639c7b23b63c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337187
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-20 23:37:36 +00:00
Greg Daniel
c5a37b1d72 Revert "Move vulkan memory uma stats to report on submit."
This reverts commit f77b6e6a68.

Reason for revert: maybe breaking chrome

Original change's description:
> Move vulkan memory uma stats to report on submit.
>
> The current model is biased towards users who make lots of allocations
> so the overall histogram gets more samples for high allocation/memory
> use. By switching this to reporting at submit time, it should make
> the reports much more even across all users.
>
> Change-Id: I269df9ea5e54439f0cca5e7637b0f39d1eaf903a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336957
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I220fe4b88f0e1c0128dbd6652a5e72a5b4ff31d4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337188
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-11-20 23:00:58 +00:00
John Stiles
dda1d31623 Enable SPIR-V disassembly output from skslc.
We now have SPIR-V golden outputs for `blend` and `shared` tests.
This exposes a handful of SPIR-V limitations for us to address.

Change-Id: Ie5278889b8a61432403d06231b17765885bee0ac
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337182
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-20 22:54:26 +00:00
John Stiles
0dd83e165a Revert "SkSL: Test/implement "geometric" intrinsics"
This reverts commit 0d5d956f7b.

Reason for revert: doesn't compile on Metal, breaks tree

Original change's description:
> SkSL: Test/implement "geometric" intrinsics
>
> Bug: skia:10913
> Change-Id: Ie82354b05db141c8ab90b1a615ddfada4f71a98b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335049
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,johnstiles@google.com

Change-Id: I3a44eaf7bafe2fa2d185186c48c39b61116dd2fe
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10913
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337186
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-11-20 22:17:38 +00:00
Robert Phillips
0758da2c60 Revert "Hook up ShaderErrorHandler in the Metal backend."
This reverts commit 69df532a55.

Reason for revert: See if this is causing the iOS redness on our tree

Original change's description:
> Hook up ShaderErrorHandler in the Metal backend.
>
> Also cleans up dumping of shader code to use GrShaderUtils.
>
> Change-Id: I4d2a13e1a54284d7da0242b74cebb3900921fc35
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337077
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=jvanverth@google.com,brianosman@google.com

Change-Id: I34125bd560cfbd12e50c732137cf921067457be2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337184
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-20 22:00:09 +00:00
Robert Phillips
10089c6a42 Revert "Remove legacy SkImage::MakeFromYUVATextures."
This reverts commit df29db4c41.

Reason for revert: blocking the G3 roll

Original change's description:
> Remove legacy SkImage::MakeFromYUVATextures.
>
> Bug: skia:10632
> Change-Id: Iad8989e0ae5aa6921e8e2e27ba375221f2af0262
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336959
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Id77c1679a96ad9c1be93e6e29449cc4785a3983b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10632
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337183
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-20 21:51:40 +00:00
Robert Phillips
2c21a11923 Remove uses of SkCanvas::flush
afaict the perf surprises associated with:

https://skia-review.googlesource.com/c/skia/+/334417 (Remove SkBaseDevice::flush)

were bc Ganesh resolves MSAA buffers for SkCanvas::flush but doesn't do so for GrDirectContext::flush.

Where possible this CL switches SkCanvas::flush to SkSurface::flush (which will also resolve MSAA buffers) so that when https://skia-review.googlesource.com/c/skia/+/334417 relands there should not be any performance surprises.

Change-Id: I705ad6219f0f625a88cf3f9e8b2418a3182d298c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335866
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-11-20 21:42:38 +00:00
Mike Klein
c4e958bff3 tweak SkVMBlitter for paints with no shader
As written today we push two sets of the paint color uniforms (4 floats
each set, 8 total): the blitter pushes one unpremul set itself to pass
to shaders that would like to use them, and when there's no shader, we
synthesize an Color4Shader using the paint color that ends up pushing
the other set, this time premul.

When the paint color is opaque there's no difference between these two
sets of uniforms, and when not, well, it's just a few cheap *hoisted*
multiplies to go from that first unpremul set to premul.  So no real
pressing need to push those premul values at all.

This CL adds a new SkShaderBase subclass PaintColorShader used only for
that case where we're synthesizing a shader from the paint color, and
just does what I've described, `return premul(paint);`.

I really only did this because I've been poking around in the debugger
looking for some other bug and noticed the duplicate values in the
uniforms array.  I expect no real-world effect from this CL except fewer
uniforms to look at in the debugger.

Change-Id: I5e1c17945ed77467c91e351f58fcf900674c4391
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337196
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-11-20 21:00:17 +00:00
John Stiles
445df8d115 Factor out redundant code for compiling GLSL/Metal/SPIR-V/CPP/H files.
Change-Id: I4eb9fb50e645f503d71cd6423bfc38076a7c2119
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336777
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-20 20:51:47 +00:00
Michael Ludwig
b73349612c Don't allow replaceClip to exceed bitmap device size
SkRasterClip::setRect assumes the incoming rect is safe, and has no
knowledge of a root bounds. SkRasterClipStack does know the root bounds
that cannot be changed.

Change-Id: I4e5850aac026d153ee9a8ce2315014896fa1b1d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337076
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2020-11-20 20:40:47 +00:00
Adlai Holler
da1c4d2a29 Spruce up iOS viewer and cut CPU drain
Main outcome here is that we only draw once per frame instead
of pinning the CPU. We also cut out a little extra traffic – an
autorelease pool per draw, but trivial. We also fix an overrelease
on NSProcessInfo.arguments, and a missing -init for the UIViewController
etc.

Change-Id: Ibb5ea5832bc65d2ff60351d4e3b76fd3b4ff88ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337116
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-11-20 20:32:17 +00:00
Jim Van Verth
69df532a55 Hook up ShaderErrorHandler in the Metal backend.
Also cleans up dumping of shader code to use GrShaderUtils.

Change-Id: I4d2a13e1a54284d7da0242b74cebb3900921fc35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337077
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-20 20:15:47 +00:00
Brian Osman
0d5d956f7b SkSL: Test/implement "geometric" intrinsics
Bug: skia:10913
Change-Id: Ie82354b05db141c8ab90b1a615ddfada4f71a98b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335049
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-20 19:30:47 +00:00
Mike Reed
74c51acb2e resolve filterquality up front in imageshader
This simplifies the shader down to only 2 states:
- use the explicit SkSamplingOptions it has
- look at the paint's enum

Ultimate goal: remove the paint's enum

Middle goal: remove references/reliance on the enum downstream
in the code. This CL is partway on that.

Possible next step: retool legacy bitmapprocshader to explict work with
FilterOptions (not SkFilterQuality) -- so that eventually the enum
appears *only* when we see the paint, and can immediately turn it
into FilterOptions.

Another next-step: add SkSamplingOptions to drawImage/drawImageRect,
to make it easier to update call-sites to not rely on the paint.

Bug: skia:7650
Change-Id: Ic8e6e96af1dc74c9e1b398e7b66a4368461bf7ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335218
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-11-20 19:26:07 +00:00
Brian Osman
5626998ac4 SkSL: Reduce default heap usage, improve heap benchmarks
We were always pre-loading the fragment and vertex modules, but deferred
loading all others. Those two take up about 300 KB of heap. Now, all
modules are deferred, so compiler instances that don't need them (like
the one used for runtime effects) are much smaller.

Now that we can get better fine-grained numbers, added two more
benchmarks, to track actual baseline usage, plus the usage in the two
most likely configurations.

Change-Id: Idfbcd52c8afee566ac42ab827c80c940f91c4ad7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337176
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-20 19:17:17 +00:00
John Stiles
0f46450775 Reland "Remove inliner from IR generation stage."
This reverts commit 4c412bce4c.

Reason for revert: investigating Pinpoint failure cases, if any

Original change's description:
> Revert "Reland "Remove inliner from IR generation stage.""
>
> This reverts commit e497a08065.
>
> Reason for revert: Pinpoint disagrees
>
> Original change's description:
> > Reland "Remove inliner from IR generation stage."
> >
> > This reverts commit 941fc7174f.
> >
> > Reason for revert: performance now seems to be roughly equal or better
> > (~1%) over several trials.
> > Nanobench: http://screen/A8e8sojaXBgbMgF
> >
> > Original change's description:
> > > Revert "Remove inliner from IR generation stage."
> > >
> > > This reverts commit 21d7778cb5.
> > >
> > > Reason for revert: Pinpoint absolutely hates this change
> > >
> > > Original change's description:
> > > > Remove inliner from IR generation stage.
> > > >
> > > > There is no need to inline code during IR generation, as the optimizer
> > > > can now handle this.
> > > >
> > > > Change-Id: If272bfb98e945a75ec91fb4aa026e5631ac51b5b
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315971
> > > > Commit-Queue: John Stiles <johnstiles@google.com>
> > > > Commit-Queue: Brian Osman <brianosman@google.com>
> > > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > > Auto-Submit: John Stiles <johnstiles@google.com>
> > >
> > > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
> > >
> > > Change-Id: I62c235415bcdc92a088e2a7f9c3d7dbf7e1bf669
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317976
> > > Reviewed-by: John Stiles <johnstiles@google.com>
> > > Commit-Queue: John Stiles <johnstiles@google.com>
> >
> > TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
> >
> > Change-Id: I6189806c678283188f4b67ee61e5886f88c2d6fc
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324891
> > Reviewed-by: John Stiles <johnstiles@google.com>
> > Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
>
> Change-Id: I79149467565f22f53b8c28868dd53b80f3421137
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325626
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I2727bd4a2b43e8d12b36b1979ce6fe4a2d935380
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335936
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-20 18:44:07 +00:00
Robert Phillips
5c80964048 Update GrProgramInfo's constructor
Change-Id: I3a8ca6913ad64ac4fc29e63f7e26db128774c407
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337118
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-20 18:22:17 +00:00
Michael Ludwig
6c1191d749 Revert "Simplify layer bounds syncing and no-device error handling in SkCanvas::internalSaveLayer"
This reverts commit b27ba538ec.

Reason for revert: causes invalid memory accesses due to replaceClip use, and replaceClip() is probably not the right operation to use
to emulate a layer when no layer was the strategy or failed to allocate.

Original change's description:
> Simplify layer bounds syncing and no-device error handling in SkCanvas::internalSaveLayer
>
> This corrects some subtle bugs that can occur with recording canvas or
> if a device fails to be created for a new layer, where the stashed
> matrix would not be restored properly. Since no new DeviceCM would get
> added in those cases, the canvas' total matrix wouldn't get fixed in the
> paired onRestore() and it would remain dirty for the remainder of the
> canvas's lifetime.
>
> After this change, the underlying SkDevice's bounds are also kept in
> sync with the intent of the saveLayer when kNoLayer_Strategy is used.
> Previously, the bounds would be applied to the canvas' conservative clip
> and quick reject bounds, but the device would remain un-updated. As we
> move towards SkNoPixelsDevice taking over the conservative clip bounds,
> this ensures bounds remain up to date within a saveLayer/restore pair
> even if no layer was allocated.
>
> Change-Id: I5ca389bdd624ea7278106da863a96e9d8f90e2d1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335861
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

TBR=mtklein@google.com,bsalomon@google.com,reed@google.com,michaelludwig@google.com

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1151195, chromium:1151270, chromium:1151294, chromium:1151320, chromium:1151322
Change-Id: I9db07916ffc450cc6ecc9188d72bb7c35770a974
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337117
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-20 17:10:58 +00:00
Greg Daniel
f77b6e6a68 Move vulkan memory uma stats to report on submit.
The current model is biased towards users who make lots of allocations
so the overall histogram gets more samples for high allocation/memory
use. By switching this to reporting at submit time, it should make
the reports much more even across all users.

Change-Id: I269df9ea5e54439f0cca5e7637b0f39d1eaf903a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336957
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-20 17:01:56 +00:00
Brian Salomon
df29db4c41 Remove legacy SkImage::MakeFromYUVATextures.
Bug: skia:10632
Change-Id: Iad8989e0ae5aa6921e8e2e27ba375221f2af0262
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336959
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-20 16:48:16 +00:00
John Stiles
c30fbcaf77 Allow swizzle optimizations to apply to any 'trivial' ctor fields.
This allows swizzle removal to apply in more cases; in particular, we
can now optimize away extra swizzles caused by zero/one swizzle-
components quite effectively.

The "trivial expression" code was lifted from the inliner. Some subtle
changes in trivial-expression determination affect the inliner's results
in boring, non-meaningful ways. In particular, multi-argument
constructors containing all-constant values are now considered trivial,
whereas previously only single-argument constructors made the trivial-
ness cut. This allows the inliner to propagate some values that it
wouldn't have before.

Change-Id: I9a009b6803d9ac9595d65538252ba81c2b7166a7
Bug: skia:10954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336156
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-20 16:35:16 +00:00
John Stiles
f7da92372a Enable Mac to build with SK_VULKAN enabled.
We no longer support MoltenVK, so we can't render using Vulkan on Mac,
but this change allows Macs with the SDK installed to compile Vulkan
code and use SPIRV-Tools.

Change-Id: I5baaf80de259e406495002a5fbfec89dbd1357b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336678
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-11-20 16:32:36 +00:00
Greg Daniel
42dbca51f4 Pass in the color load op to GrProgramInfo.
In follow on CLs we need to know what the load op is when we try to use
discardable msaa attachments. For vulkan the load op affects how we
copy the resolve attachment into the msaa attachment, which changes the
render pass we use (adds extra subpass). We need to be able to make a
compatible render pass to compile programs.

Bug: skia:10979
Change-Id: I40c23a18b251af6a2ad3b78a1f6382bdba0b90c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336598
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-20 16:29:56 +00:00
John Stiles
b69a9d48bf Code cleanup: Remove references to IRNodes from SkSLPool.
There is no longer anything IRNode-centric about SkSLPool; it is not
optimized around specific allocation sizes, and could be used to
allocate anything that is associated with a Program. Update comments and
function names to reflect this.

Change-Id: Ica1a78f7415edb25b93a93d00fe54557883c5eed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334676
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-20 15:30:26 +00:00
Brian Osman
0006ad01ce Stop cloning builtin functions
Previously, any builtin functions would be optimized as a side-effect of
optimizing programs that used them. Now that shared elements aren't
being optimized in that way, we explicitly optimize any shared modules
when they are first created. We don't remove dead elements, but we
we do substitute settings, simplify, and inline.

Bug: skia:10905
Change-Id: I701b5e9f52fb880ef3e6f4c67694d08602f47e95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336440
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-20 15:02:54 +00:00
Adlai Holler
e2296f7a70 Pass the writeView as a const-ref instead of a pointer …
The important part is in GrOpFlushState.h were previously
we were taking a mutable pointer to the view, which should
at least be a const pointer and was making us do funky things
in some of the calling code. But I decided to go all the way
and do a const ref instead which is The Way It Should Be (tm).

Change-Id: I399d102e8b5e0a5059168cc450ae66f12ad47e13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336451
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-11-20 14:59:34 +00:00
John Stiles
a446ca15ed Reland various cleanups to SkSLMain.
These cleanups were reverted, as they were part of the CL that added
`--` delimiters to skslc. This CL reinstates the cleanups, but does not
reinstate `--` delimited multiple-command-line support in skslc.

Change-Id: Id70ed87aa239b46d232492fc48791158b35512f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336677
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-20 14:13:43 +00:00
John Stiles
5570c5156f Replace various assertions inside SPIR-V codegen with errors.
These assertions were all currently reachable simply by compiling the
test code in /tests/sksl/shared/. Presumably many of these will actually
require a better fix going forward.

Change-Id: If59e0bfa1b248a5db9a79def736d437a9e5f7ee4
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336676
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-20 14:12:03 +00:00
John Stiles
8c58899371 Fix fuzzer crash when casting between int and float.
The fix submitted at http://review.skia.org/335868 did not support
casts. The fuzzer discovered this shortcoming right away.

Change-Id: I2f5166528cee41367348564d4e664476fd5704ff
Bug: oss-fuzz:27650
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336656
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-20 14:07:03 +00:00
skia-autoroll
9dce4d081f Roll ANGLE from 8b76d37f9f9a to 777749aafaac (19 revisions)
8b76d37f9f..777749aafa

2020-11-20 b.schade@samsung.com Vulkan: Fix image copies with renderbuffers
2020-11-20 cnorthrop@google.com Capture/Replay: Limit GL_MAX_IMAGE_UNITS during capture
2020-11-20 cclao@google.com Vulkan: Add feature flag to fallback rotation to use driver uniform
2020-11-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from 4fe17f3425ee to 3f73b676d6e8 (9 revisions)
2020-11-19 geofflang@google.com roll_aosp: Pass more forceful args to gclient sync
2020-11-19 syoussefi@chromium.org Vulkan: Delay defining D/S content to endRenderPass
2020-11-19 geofflang@google.com Skip tracking non-preprocessor tokens in disabled if-blocks
2020-11-19 jdarpinian@chromium.org Don't use CGL in Mac Catalyst on Apple Silicon
2020-11-19 syoussefi@chromium.org Add angle_deqp_khr_gles32_tests to gn_isolate_map.py
2020-11-19 jmadill@chromium.org Trace Tests: Add renderer string logging.
2020-11-19 jonahr@google.com GL: Fix missing BufferBinding case in GetBufferBindingQuery
2020-11-19 m.maiya@samsung.com Vulkan: Support gl_SampleMask with non-const index
2020-11-19 m.maiya@samsung.com Vulkan: Support OES_sample_variables extension
2020-11-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Tools from 67d0fc6389ff to 6ef69fbda85b (2 revisions)
2020-11-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 1f2fcddd3963 to 671914c28e82 (1 revision)
2020-11-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from 169d0c7f8a7b to ec5cd38a0ca6 (2 revisions)
2020-11-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from bb96f79d0e15 to 282aa417236a (5 revisions)
2020-11-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 45b78e7b52a7 to 62214500294f (493 revisions)
2020-11-19 syoussefi@chromium.org Basic support for running deqp khr gles32 tests

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC lovisolo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Tbr: lovisolo@google.com
Test: Test: LEGO MECTest: Test: dEQP-GLES31.functional.copy_image.*renderbuffer*
Change-Id: Iadb83f219f1d81d63fe912a85735c4b8056d4c8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336648
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-20 05:19:23 +00:00
skia-autoroll
bf24c931ea Roll Dawn from ce207be41fd6 to 1a14e7e02441 (2 revisions)
https://dawn.googlesource.com/dawn.git/+log/ce207be41fd6..1a14e7e02441

2020-11-19 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 46d9c7745efa to 36d9a061c847 (13 revisions)
2020-11-19 jiawei.shao@intel.com Skip SwapchainTests/SwitchPresentMode on Linux Intel Vulkan drivers

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dawn-skia-autoroll
Please CC kainino@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: kainino@google.com
Change-Id: Ibb1aec390dae0c225eea16b9c129717088299fdc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336649
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-20 05:16:53 +00:00
skia-autoroll
4f660f22d9 Roll SwiftShader from 060020166679 to de9e649438ed (3 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/060020166679..de9e649438ed

2020-11-19 capn@google.com Fix GN build for aarch64
2020-11-19 zzyiwei@google.com AHB: minor clean up to avoid build failures on different platforms
2020-11-19 capn@google.com Add GN builds for Reactor unit tests

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-skia-autoroll
Please CC lovisolo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: lovisolo@google.com
Change-Id: Ia7b74b059d1add1f68c3b31b2bbeebd552144b6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336647
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-20 05:09:53 +00:00
John Stiles
ed289e777c Simplify _blend_set_color_saturation, removing an instruction.
This tightens up our intrinsics slightly; after inlining, it eliminates
one scratch variable. (We no longer need to copy `sda` into `hueColor`
as hueColor is now unchanged.)

Change-Id: Iece5ba2fe11cde54481704a1787114a2c2a66d9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336599
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-19 22:57:10 +00:00
Michael Ludwig
b27ba538ec Simplify layer bounds syncing and no-device error handling in SkCanvas::internalSaveLayer
This corrects some subtle bugs that can occur with recording canvas or
if a device fails to be created for a new layer, where the stashed
matrix would not be restored properly. Since no new DeviceCM would get
added in those cases, the canvas' total matrix wouldn't get fixed in the
paired onRestore() and it would remain dirty for the remainder of the
canvas's lifetime.

After this change, the underlying SkDevice's bounds are also kept in
sync with the intent of the saveLayer when kNoLayer_Strategy is used.
Previously, the bounds would be applied to the canvas' conservative clip
and quick reject bounds, but the device would remain un-updated. As we
move towards SkNoPixelsDevice taking over the conservative clip bounds,
this ensures bounds remain up to date within a saveLayer/restore pair
even if no layer was allocated.

Change-Id: I5ca389bdd624ea7278106da863a96e9d8f90e2d1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335861
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-19 21:24:40 +00:00
Brian Osman
9496fe5bce Stop cloning elements that declare builtin variables
Instead, add them to the shared program element list of any program that
needs them.

Bug: skia:10905
Change-Id: Ieb470af65eb254154d238554eecffdcbbf268cf1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335867
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-19 20:42:50 +00:00
Michael Ludwig
ad5ec1ae85 Fix color stop positions when computing degenerate gradient color
For non-degenerate gradients, the positions are pinned to [0, 1] and
forced to be monotonically increasing in the constructor of
SkGradientShaderBase. This isn't ever called for degenerate gradients,
so the average_gradient_color helper function needs to make the same
fixes or it may calculate an invalid color (e.g. negative alpha because
the original positions are not sorted).

Bug: chromium:1149216
Change-Id: I95c6e66ebb57722370ef2f5dbba3d8d66727e48b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336437
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-19 20:13:20 +00:00
Robert Phillips
19006657a9 Resolve issue with flush-time opsTask management
Despite what the bug says, I believe the only issue here was that
all the flush-time opsTasks weren't guaranteed to be in
'fOnFlushRenderTasks'. Since the users of flush-time opsTasks
use GrRenderTargetContext::addDrawOp, if the opsTask were to be
split, new ops would be added to the correct/new opsTask.

Bug: skia:9357

Change-Id: I90577bcc852419a9e0c31d858f71cda9f6f6b6a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336435
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-19 20:10:10 +00:00
Jim Van Verth
9e64047a04 Add MTLBinaryArchive support to iOS Metal build
Change-Id: I7a4f58e4fc1fc18c42de372dd480e0681000e2f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333758
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-11-19 20:00:30 +00:00
Brian Osman
133724cc02 SkSL::Program: Maintain a separate list of shared program elements
Change program iteration so that default iteration (over owned & shared
elements) only permits const access. Add a separate non-const iterator
that only visits owned elements.

Initially, nothing is being placed in the shared list. Follow-up CLs
will move builtin variable declarations, builtin functions, etc.

Bug: skia:10905
Change-Id: I9a5b11170117bad3ff6a43aab780c1189904417c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330477
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-19 19:42:10 +00:00
Herb Derby
1c49494d71 Add missing cache invalidate
Change-Id: I63b204e127e7deb33f6da5c7413b201bcf06ff88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336516
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-11-19 19:04:20 +00:00
Michael Ludwig
8df863fc01 Switch to static asserts for internal canvas struct sizes
Change-Id: I3f6f23459c5b5572337c3803235f165b139522d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335862
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-19 18:36:25 +00:00
John Stiles
d9076cb637 Merge foo.x, foo.y, foo.z into foo.xyz when optimizing swizzles.
When values from the same argument are used consecutively by the outer
swizzle, they can be merged in the inner swizzle. Merging isn't always
possible, of course, but it will be used where it can be:

    `half4(1, colRGB).yzwx` --> `half4(colRGB.xyz, 1)`
    `half4(1, colRGB).yxzw` --> `half4(colRGB.x, 1, colRGB.yz)`

Change-Id: Id164b046bc15022ded331c06d722f1ae3605a3bd
Bug: skia:10954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335872
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-19 18:20:24 +00:00
Herb Derby
281583ae73 processGlyphRunList -> processGlyphRun: move out loop
This change will facilitate experimenting with direct-to-op
text draws. There should be no performance change because
almost all blobs are a single run.

Change-Id: I07fb3487e0601e00507403d94bc611c5022c1408
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336447
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-19 18:15:44 +00:00
Mike Reed
8dacba3547 Migrate away for heuristics for bicubic filtering
Bug: skia: 7650
Change-Id: Id20aed3a7a2676ab053a32a95f225e60186c0851
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335593
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-11-19 18:12:04 +00:00
Chris Dalton
9458c8d44a Add an epsilon to GrPathUtils::findCubicConvex180Chops
Cubic tangents become unstable if we chop too close to 0 or 1. This
adds an epsilon to simply not chop them if it's too close.

Bug: skia:10419
Change-Id: I99e98c5d433e2cb59c767ee564e015d7ec4f7765
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336280
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-11-19 17:43:21 +00:00