Commit Graph

53992 Commits

Author SHA1 Message Date
Julia Lavrova
4414f87fa1 Revert the workaround for missing ICU API ubrk_safeClone
Bug: skia:11315
Change-Id: Iee619517b687dc722d99e73821954cadb790d98a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378977
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-03-08 15:26:25 +00:00
Brian Salomon
3fa0cdada7 SkPictureShader::asFragmentProcessor should recreate proxy for resource.
findProxyByUniqueKey merely checks if a proxy exists for a key while
findOrCreateProxyByUniqueKey checks if there is an existing texture
whose proxy was deleted and recreates a new proxy for it.

Change-Id: I352639d03769dbb9659819d52bc6927347b5a452
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381222
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-03-08 15:22:05 +00:00
Kevin Lubick
d60ecb7b7f [canvaskit] Remove unreliable perf jobs.
These have been replaced by "CanvasPerf" jobs.

Bug: skia:11331
Change-Id: Id7d625eb8ade2d93754e4021171af0ce4a5224a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381219
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2021-03-08 14:48:35 +00:00
Corentin Wallez
a0178b2513 Remove DEPS on shaderc and glslang
These were used by Dawn at some point but are no longer needed since
they are only used by Dawn's tests that aren't discovered by Skia's GN
build.

Bug: dawn:706
Change-Id: Icb75856955c16f659203ebf20462db59f4165873
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381236
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2021-03-08 14:14:55 +00:00
skia-autoroll
9196a0884d Roll Dawn from 95034f6528d4 to 010fd1a8d7c7 (1 revision)
https://dawn.googlesource.com/dawn.git/+log/95034f6528d4..010fd1a8d7c7

2021-03-05 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from f9f48c60f700 to 13ee0fbdf337 (1 revision)

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from f9f48c60f700 to 13ee0fbdf337

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 enga@google.com,cwallez@google.com,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: enga@google.com,cwallez@google.com,kainino@google.com
Change-Id: Ib336eeb43dced052549e10a0e13723572b356783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381017
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-08 07:24:34 +00:00
skia-autoroll
0530e52e3a Roll SwiftShader from 6846389f25ca to de7d5775ab25 (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/6846389f25ca..de7d5775ab25

2021-03-05 srisser@google.com Fix missing feature from vkCreateDevice case-list

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 kjlubick@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: kjlubick@google.com
Change-Id: I8f4ef5ee432f459c362a4a6f47bc1885517a31be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381036
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-08 05:05:24 +00:00
skia-autoroll
5e131206b9 Roll ANGLE from fe2efefac498 to 9bc86c50f283 (15 revisions)
fe2efefac4..9bc86c50f2

2021-03-06 lexa.knyazev@gmail.com Metal: Implement OES_draw_buffers_indexed
2021-03-06 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from a9c07acc33bc to c4e6dbe68e04 (15 revisions)
2021-03-06 ynovikov@chromium.org Skip tests failing on Ozone.
2021-03-06 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from 9be79728eafb to a9c07acc33bc (6 revisions)
2021-03-06 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from e3e89758c942 to 76f6150ffdeb (205 revisions)
2021-03-06 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from 9cdde06fb38a to 9be79728eafb (18 revisions)
2021-03-05 ynovikov@chromium.org Skip vulkan_car_parking_multiplayer on Win Intel
2021-03-05 ynovikov@chromium.org Skip CopyTextureVariationsTest failing on Ozone
2021-03-05 Amy.Liu@arm.com Revert "Compression of the data from vkGetPipelineCacheData."
2021-03-05 lexa.knyazev@gmail.com Fix Apple GPU detection for M1
2021-03-05 lubosz.sarnecki@collabora.com capture_replay_tests: Don't skip tests that pass.
2021-03-05 syoussefi@chromium.org Vulkan: Keep dynamic buffer's free list trimmed
2021-03-05 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from c0db6ae3d87d to 6691fcec0bce (2 revisions)
2021-03-05 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 084529f3a9b9 to 6846389f25ca (1 revision)
2021-03-05 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 143c12daa39f to e3e89758c942 (782 revisions)

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 kjlubick@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: kjlubick@google.com
Change-Id: Id95b47629f283cff513ec93d367a055cdee74514
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/381016
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-08 04:49:04 +00:00
Julia Lavrova
c70f8c331d Using non-breaking spaces as a hint to break too long words
Change-Id: Ic88e961ea3fb08e61340895115f514c6f5dec163
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379798
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-03-08 04:31:04 +00:00
Mike Reed
07ee548d5b Remove legacy picture-shader impl
Change-Id: Ibb4c49f101519b8290884f8da654b661e119de82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380916
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-03-07 20:55:34 +00:00
Chris Dalton
5f2932e0e3 Skip "~path" tests on Pixel5
This test crashes on the bots. Disabling until we can investigate.

Bug: skia:11152
Change-Id: I1cd8e63661a79520a698a2ba9f039dd932c577fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352465
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-03-07 16:10:55 +00:00
skia-recreate-skps
1314913ff5 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: I4758310a1f5d6ee7446c3951a2ad589ef0fa183a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380796
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2021-03-07 06:28:04 +00:00
Greg Daniel
00d6cf4368 Reland "Have GrVkRenderTarget only use GrVkAttachments and not derive from GrVkImage."
This reverts commit 9ef3f2e3da.

Reason for revert: relanding with fix

Original change's description:
> Revert "Have GrVkRenderTarget only use GrVkAttachments and not derive from GrVkImage."
>
> This reverts commit 3dc6c190da.
>
> Reason for revert: hitting assert about RT having input attachment on mali bots
>
> Original change's description:
> > Have GrVkRenderTarget only use GrVkAttachments and not derive from GrVkImage.
> >
> > This change moves the color and resolve attachments used in a
> > GrVkRenderTarget to be a GrVkAttachment. These along with the msaa
> > attachment now mean that GrVkRenderTarget no longer needs to derive from
> > a GrVkImage.
> >
> > There are a couple ugly things in this CL since GrVkTexture still is a
> > GrVkImage since we can't share attachments between GrVkRT and GrVkTex.
> > But when that gets updated in the follow on CL things will look much nicer.
> >
> > Bug: skia:10727
> > Change-Id: I2f12674d7517c6d6dea389e2d1fb7296028bcc85
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379576
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
>
> Change-Id: Ic46f3947ed9f7b2ca26e8418d643e7f89b6108d2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10727
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380459
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

# Not skipping CQ checks because this is a reland.

Bug: skia:10727
Change-Id: I7a995ee9ad35bdac34cfcfd6b0d963c3e0bb90b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380460
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-03-06 18:57:11 +00:00
John Stiles
8f440b4e1e Optimize away no-op arithmetic in ConstantFolder.
Expressions like `x * 1`, `x *= 1`, `x + 0`, `x * 0`, or `0 / x` don't
actually do anything, and can be simplified to just `x` or `0`. (The
zero case must also check that `x` doesn't have side effects, because
`0 * myFunction()` still needs to call `myFunction`.)

`0 - x` is also detected and rewritten as `-x`.
`0 / 0` is left as-is.

This logic works for scalars and vectors; matrices are left as-is.

A similar optimization also occurs in the constant-propagation pass, so
we see almost no diffs in the tests. If control-flow analysis is turned
off, we do see some improvements. (I didn't reuse the existing code at
all, since it was designed around rewriting the CFG tree, but the
concept was identical.)

Change-Id: Ia99cd81f1d4cd3dafaa43ccac6a2261e3257a185
Bug: skia:11343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380356
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-03-06 01:33:35 +00:00
Chris Dalton
cc13b3522a Reland "Use analytic AA in FillRRectOp even if the target has MSAA"
This is a reland of cad44bcdd2

Original change's description:
> Use analytic AA in FillRRectOp even if the target has MSAA
>
> Bug: skia:11396
> Change-Id: Ia29fd5c9f00006274bb2aa1db96fbad57d858786
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380016
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: skia:11396
Change-Id: I6382085ccd037b534a1ed1355c1464aaef799a44
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380477
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-03-05 23:57:15 +00:00
Greg Daniel
9ef3f2e3da Revert "Have GrVkRenderTarget only use GrVkAttachments and not derive from GrVkImage."
This reverts commit 3dc6c190da.

Reason for revert: hitting assert about RT having input attachment on mali bots

Original change's description:
> Have GrVkRenderTarget only use GrVkAttachments and not derive from GrVkImage.
>
> This change moves the color and resolve attachments used in a
> GrVkRenderTarget to be a GrVkAttachment. These along with the msaa
> attachment now mean that GrVkRenderTarget no longer needs to derive from
> a GrVkImage.
>
> There are a couple ugly things in this CL since GrVkTexture still is a
> GrVkImage since we can't share attachments between GrVkRT and GrVkTex.
> But when that gets updated in the follow on CL things will look much nicer.
>
> Bug: skia:10727
> Change-Id: I2f12674d7517c6d6dea389e2d1fb7296028bcc85
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379576
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ic46f3947ed9f7b2ca26e8418d643e7f89b6108d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10727
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380459
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-03-05 22:48:27 +00:00
Ben Wagner
83eed35765 SkShaper_coretext correct dependencies.
Adds proper framework dependencies and moves from using ArenaAlloc
to header only SkAutoSTArray so it can be built in a shared build.

Change-Id: I6467153915e00a28d5569869187aecc3dd1f0112
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380318
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-03-05 22:06:25 +00:00
John Stiles
8ef4d6c882 Add Viewer checkbox to toggle Control-Flow Analysis.
This gives Viewer a way to dynamically toggle CFA off and on, so we can
immediately see the impact on shader optimization.

Change-Id: I912df70de126a74a1f0d11c511b2acc64f1e9f28
Bug: skia:11319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380456
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-03-05 22:00:14 +00:00
John Stiles
a8f6b6fe8a Update Shaders tab in Viewer.
- Added "Dump Shaders" button; this writes the shaders to disk in the
  `/resources/sksl` directory. This will allow us to more easily check
  real-world shader code generation, instead of synthetic examples.
- Renamed "Load" and "Save" to "View" and "Apply Changes," to clarify
  that they are not about files on disk. (Otherwise they seemed
  confusing when placed next to a Dump Shaders button.)

Also, fixed a bug which would prevent a new deferred action from being
registered while running deferred actions.

(This CL implements the "test real-world shaders" portion of
http://go/optimization-in-sksl)

Change-Id: I7626a9e9c4f3ecb31b51f29b8106e4ca55de4dd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380317
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-05 21:47:29 +00:00
Ethan Nicholas
fe5d6928d0 DSL var values are now specified at construction time rather than in
Declare

This solves several issues caused by the lack of ordering guarantees in
C++; it was possible for the SkSL backend to look for the value of a
variable before its Declare() call gets processed. Moving the initial
value out of Declare should fix this whole class of problems.

Change-Id: I428fe230f1c312a0128c1f00c2a36cb95f4590a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380358
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-05 21:47:28 +00:00
Chris Dalton
e3aec3c603 Revert "Use analytic AA in FillRRectOp even if the target has MSAA"
This reverts commit cad44bcdd2.

Reason for revert: Triggered an Adredo330 bug

Original change's description:
> Use analytic AA in FillRRectOp even if the target has MSAA
>
> Bug: skia:11396
> Change-Id: Ia29fd5c9f00006274bb2aa1db96fbad57d858786
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380016
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,csmartdalton@google.com

Change-Id: Ic51a279f9fefe03b28182bf1222c2e26625f5bf3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380476
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-03-05 21:47:26 +00:00
Brian Osman
e23c03d337 Make program key descriptions available in release builds
Whenever we need the description (as we're putting something in the
persistent cache), go back and re-compute the key to get the
description. This pattern means that we pay a (very) small overhead for
virtual dispatch in the common case, and only pay for the expensive
string work when we're already doing expensive work (compiling).

Bug: skia:11372
Change-Id: I3d4dc19f2d8883f8117f5f6489fc852cf9503eb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380359
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-05 21:46:10 +00:00
John Stiles
6fb520fcd5 Improve optimization of prefix expressions at IR time.
- Values from constant variables are folded in when it helps, e.g.:

    const bool SHINY = true;
    const float SHININESS = 2;
    if (!SHINY) {  // <-- optimizes directly to `false`
       param = -SHININESS; // <-- optimizes to `-2`

- Doubled-up logical-not and negation are stripped:

    y = -(-x); // <-- optimizes to `y = x;`
    b = !!a; // <-- optimizes to `b = a;`

Removal of doubled-up negation and logical-not was actually never
implemented in the constant-propagation phase; I just noticed it while
I was here and thinking about it.

Change-Id: Ie28bb9b5af91376f03d926e26e37f4a131bbf550
Bug: skia:11343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379298
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-05 21:41:55 +00:00
John Stiles
28054added Optimize ternary tests that check a const variable.
This enables the ternary to be optimized away in code like:
   const bool SHINY = true;
   color = SHINY ? add_shine(x) : x; // to --> `color = add_shine(x);`

Without constant propagation.

Also, I added a unit test for ternary expression simplification; I
wasn't able to find an existing one.

When the optimization flag is disabled, this CL actually removes the
optimization of `true ? x : y` --> `x` entirely; previously, this
substitution would be made regardless of optimization settings.

Change-Id: I93a8b9d4027902d35f8a19cfd6417170b209d056
Bug: skia:11343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379297
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-03-05 21:41:05 +00:00
Greg Daniel
3dc6c190da Have GrVkRenderTarget only use GrVkAttachments and not derive from GrVkImage.
This change moves the color and resolve attachments used in a
GrVkRenderTarget to be a GrVkAttachment. These along with the msaa
attachment now mean that GrVkRenderTarget no longer needs to derive from
a GrVkImage.

There are a couple ugly things in this CL since GrVkTexture still is a
GrVkImage since we can't share attachments between GrVkRT and GrVkTex.
But when that gets updated in the follow on CL things will look much nicer.

Bug: skia:10727
Change-Id: I2f12674d7517c6d6dea389e2d1fb7296028bcc85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379576
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-03-05 20:52:15 +00:00
John Stiles
f04e09cd9b Optimize Swizzles inside Swizzle::Make.
Swizzle optimizations now occur at IR generation time. These
optimizations are redundant with the control-flow optimization phase so
they are mostly not visible in our test output, but they do affect DSL
test results. Interestingly, they do improve our test output slightly
as well, for various reasons (e.g. we do not fully optimize lvalues in
the control-flow pass).

Change-Id: I6ebe6d71a5c22d9823b5fa500e43078915cbfb45
Bug: skia:11343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372257
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-03-05 20:09:55 +00:00
Brian Salomon
d63638bb7b Copy on write for wrapped backend texture surfaces.
Makes SkImage_Gpu backed by two proxies, an original and a copy. The
image uses the original until a new render task is bound to it at which
point further uses of the image will use the copy. If the image is ever
used off a GrDirectContext we fall over to the copy. If the copy is
never used and never can be used by the next flush then the render
task that populates it is marked "skipped" and we don't perform the
copy.

Bug: skia:11208

Change-Id: Id255f4a733acc608c8a53c1a5633207aeafc404b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366282
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-03-05 19:50:05 +00:00
Chris Dalton
cad44bcdd2 Use analytic AA in FillRRectOp even if the target has MSAA
Bug: skia:11396
Change-Id: Ia29fd5c9f00006274bb2aa1db96fbad57d858786
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/380016
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-03-05 17:28:05 +00:00
Mike Reed
319565ac6e Clean up prev experiment.
- Only need 4 (not 5) samples
- Document some of the math
- Use round of CTM to better match 'brute-force' version

Change-Id: Ibcc8e8eabc10158da8eecaba303385ed79218126
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379847
Reviewed-by: Mike Klein <mtklein@google.com>
2021-03-05 15:56:14 +00:00
Peng Huang
a42ed48e84 Fix a double free problem in YCbCrImageGM::createYCbCrImage()
If SkImage::MakeFromTexture() fails, the reelase_ycbcrhelper will
also be called, so ycbcrHelper.release() should be always called.

Change-Id: I104e02155da653bcb465723cbead595f16459fca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379848
Commit-Queue: Peng Huang <penghuang@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-03-05 15:36:25 +00:00
Herb Derby
bf2dd2af49 Reland "rename GrSDFTOptions to GrSDFTControl"
This is a reland of 40a9061203

Original change's description:
> rename GrSDFTOptions to GrSDFTControl
>
> Change-Id: Ie03fce7a99a9f71b18d54e3cd35e7675fb7f8912
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379616
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Change-Id: Iba0816159a8ef99448a0040c487e56700b96be5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379845
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-03-05 15:24:35 +00:00
John Stiles
b9e4f649b4 Simplify constructors at IR generation time.
This performs the same simplifications as the control-flow phase, but at
IR generation time. There's no visible difference in the tests (besides
DSL) because these aren't new optimizations; they're just happening
at a different phase of compilation.

Change-Id: I26d241167b0e690b23f8f4370339714783c8d6fd
Bug: skia:11343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371482
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>
2021-03-05 15:07:35 +00:00
John Stiles
0404933136 Remove CFG-based check for missing value-returns.
This check is redundant; we now determine this at function finalization
time (http://review.skia.org/379056) and error out before this check
can be reached.

Change-Id: I1706adb90435b430883d7d1ab44cb5dc98fccd8c
Bug: skia:11377
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379836
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-05 15:04:06 +00:00
John Stiles
532138cea7 Restore 'medPrecision' label in ellipse effect FP.
This was removed in http://review.skia.org/377842 to allow compilation
without control-flow analysis. We now support const bools in @if
statements (as of http://review.skia.org/379063) and can relax this
restriction a bit.

Change-Id: If3e8018c599d765075568a90af94fb4e4cb25118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379797
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-05 14:00:15 +00:00
Mike Reed
48bfa48809 Revert "cache the creation of one GrAtlasTextOp"
This reverts commit 4b1fb7ca90.

Reason for revert: breaking chrome roll (android-pie)?

Original change's description:
> cache the creation of one GrAtlasTextOp
>
> GrAtlasTextOp has a high probability of being merged with the
> previous op. This cache keeps using the same op to merge with
> keeping memory warm.
>
> This show about 5.75% improvement in skpbench on desk_nytimes.
>
> When compiling for ios 9 or earlier, this optimization is
> disabled.
>
> Change-Id: I13ccbef6dcd4b9d82103bf20bba7d94f3e4fb6f4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376718
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=bsalomon@google.com,herb@google.com,michaelludwig@google.com

Change-Id: I2def6e1043dcca2fd41c40facd20b4d18971ed17
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379840
Reviewed-by: Mike Reed <reed@google.com>
2021-03-05 11:15:53 +00:00
Mike Reed
9edff53a73 Revert "rename GrSDFTOptions to GrSDFTControl"
This reverts commit 40a9061203.

Reason for revert: breaking chrome roll (android-pie)?

Original change's description:
> rename GrSDFTOptions to GrSDFTControl
>
> Change-Id: Ie03fce7a99a9f71b18d54e3cd35e7675fb7f8912
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379616
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=herb@google.com,robertphillips@google.com

Change-Id: I0483cbada23c76bdd5ccdb51936bb20a819343cb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379839
Reviewed-by: Mike Reed <reed@google.com>
2021-03-05 11:15:22 +00:00
Mike Reed
606a9ab831 Revert "add noexcept to GrAtlasTextOp delete"
This reverts commit 6ba242d2a2.

Reason for revert: breaking chrome roll (android-pie)?

Original change's description:
> add noexcept to GrAtlasTextOp delete
>
> Change-Id: Icb2d8ce9ac75454b89342aa737d563cf45eaba3e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379756
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

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

Change-Id: Ib42e19110c1221157d4245233f09a18401bd4f7d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379838
Reviewed-by: Mike Reed <reed@google.com>
2021-03-05 11:14:44 +00:00
skia-autoroll
994a571fc7 Roll Dawn from 637d947937b7 to 95034f6528d4 (8 revisions)
https://dawn.googlesource.com/dawn.git/+log/637d947937b7..95034f6528d4

2021-03-05 bclayton@google.com Enable the BoundArrayAccessors tint transform
2021-03-05 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from e18a18bc1c71 to f9f48c60f700 (8 revisions)
2021-03-04 cwallez@chromium.org Rename Buffer/TextureCopyView to ImageCopyBuffer/Texture.
2021-03-04 cwallez@chromium.org DEPS: Make everything gated on dawn_standalone
2021-03-04 cwallez@chromium.org Make Extent3D::width non-optional.
2021-03-04 enga@chromium.org Statically link the dawn_end2end_tests
2021-03-04 bclayton@google.com ShaderModule: Use tint::diag::List::str()
2021-03-04 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from ec44eef965b6 to e18a18bc1c71 (2 revisions)

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from ec44eef965b6 to f9f48c60f700

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 rharrison@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: rharrison@google.com
Change-Id: I1c5082b209bcb06fb0ff0ff6289f6b2a5a89409a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379936
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-05 07:10:54 +00:00
skia-autoroll
d42fe062d0 Roll ANGLE from 90db604919ba to fe2efefac498 (14 revisions)
90db604919..fe2efefac4

2021-03-04 m.maiya@samsung.com Add FramebufferAttachmentPerfTest
2021-03-04 enga@chromium.org Revert "Add support for Linux GPU info with Vulkan backend"
2021-03-04 m.maiya@samsung.com Vulkan: Unmap buffer when adding to mBufferFreeList
2021-03-04 natsu@google.com Vulkan: Enable EGL_ANDROID_recordable for EGL configs on SwiftShader
2021-03-04 jmadill@chromium.org infra/config: Rename console/list views.
2021-03-04 syoussefi@chromium.org Translator: Rename GLSL to SPIR-V in Vulkan and Metal output
2021-03-04 ynovikov@chromium.org Suppress UNINSTANTIATED_PARAMETERIZED_TEST failures on Ozone
2021-03-04 xiaoxuan.liu@arm.com Add support for Linux GPU info with Vulkan backend
2021-03-04 lexa.knyazev@gmail.com Partially upgrade codegen to Python 3
2021-03-04 ynovikov@chromium.org Replace Win x64 dEQP GPU.FYI bots with chromium.angle bots
2021-03-04 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 106e01583a3a to 084529f3a9b9 (1 revision)
2021-03-04 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 6c3f8d8c39b9 to c0db6ae3d87d (6 revisions)
2021-03-04 syoussefi@chromium.org Vulkan: Fix overlay graph widgets
2021-03-04 syoussefi@chromium.org Vulkan: Fix Overlay for prerotation

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 stani@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: stani@google.com
Test: Test: `cts -m CtsMediaTestCases` on Cuttlefish w/ SwANGLE
Change-Id: Ib5cf22d2c0dfbd5d2eecf53adfdc843df2e646dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379937
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-05 05:16:54 +00:00
skia-autoroll
324e08346c Roll SwiftShader from 084529f3a9b9 to 6846389f25ca (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/084529f3a9b9..6846389f25ca

2021-03-04 srisser@google.com Implement VK_KHR_timeline_semaphore

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 stani@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: stani@google.com
Change-Id: Icebcd2e5cf3721eeba88cb79100e0ec72cf8eafd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379956
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-05 04:53:54 +00:00
Mike Reed
3b58d38966 Upscaling demo
Change-Id: I22f26ff2a618f95f6f4f9ab0962a3fede509f1e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379837
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-03-05 02:30:49 +00:00
Herb Derby
6ba242d2a2 add noexcept to GrAtlasTextOp delete
Change-Id: Icb2d8ce9ac75454b89342aa737d563cf45eaba3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379756
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-03-04 23:55:49 +00:00
Brian Osman
c8d836f176 Fix copy-paste error in prim-proc attribute key generation
Change-Id: I40844d08af9b027a2d6095d485537dad802a92c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379796
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-04 22:53:25 +00:00
John Stiles
b3dcbb12ef Detect functions that fail to return a value, without using CFG.
This check now runs at function finalization time, before constant
propagation has occurred; this affected the "DeadIfStatement" test.

Our detection isn't smart enough to realize that a loop will run zero
times, so it treats `for` and `while` loops as always running at least
once. This isn't strictly correct, but it actually mirrors how the CFG
implementation works anyway. The only downside is that we would not flag
code like `for (i=0; i<0; ++i) { return x; }` as an error.

Change-Id: I5e43a6ee3a3993045559f0fb0646d36112543a94
Bug: skia:11377
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379056
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-04 22:47:05 +00:00
Ethan Nicholas
daed2592bb Made SkSL DSL into public API
In addition to the unsurprising changes to eliminate references to
src/, we also had to tighten up some C++17-isms as they are not
permitted in public headers.

Change-Id: Ie5005a33d7a135e69fb66beca5e7a5f960dbd453
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378496
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-04 21:03:58 +00:00
Mike Reed
ff83dda8cd Cache image behind picture-shader
PictureShader = picture + tiling + depth/colorspace + filtering [+ scale]

Today we cache the imageshader that is used to rendering. However, the
key for that cache is the pictureshader's ID itself... which means if
we have several, all using the same picture (but maybe diff tiling) we
would create dup cache entries.

Idea:
1. only cache the image (rastered picture), not an imageShader
2. key the cache on the picture's ID, not the shader's

Several implications of this:

1. Should get more cache reuse, since we don't care about the
shader's ID (which is just wrapping a picture+tiling, etc.)

2. We also eliminate the indirection of creating a PictureImage. Instead
we're creating real (pixel) images, and caching those. This removes one
extra layer of "cache".


Idea: when we cache something for pict
Change-Id: I51cf4e9bff3c91ce1872876597d3d565039d8c7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377844
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-03-04 20:48:30 +00:00
Brian Osman
3316796acb Cleanup and reorganize GrProgramDesc::Build and key layout
Move all of the processor-specific information into functions, rather
than splitting it between the calling and called code.

Stop putting the size of the key into the key. This was an attempt to
avoid collisions (I assume), but felt odd. Instead, add a few important
bits to more reliably protect against collisions, like # of vertex
attributes, # of child FPs, etc.

Important: Stop calling visitTextureEffects to put fp sampler info in
the key. That function visits the entire fp *tree*, so we were adding
sampler information in large FP trees many times. Instead, just add the
sampler information when the specific fp we're emitting is a texture
effect.

Finally, change addString to appendComment, to make it clear that it
doesn't impact the actual key at all.

Bug: skia:11372
Change-Id: Ibf10db1165b27857e5e5e712db538749b41883a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379736
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-04 20:47:31 +00:00
John Stiles
9b660ef638 Reformat generated files with bin-packing off.
Housekeeper-PerCommit-GeneratedFiles has been complaining due to
http://review.skia.org/379656

Change-Id: Id6689261b6e1fbb444730babd52ccfcbd9929e21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379738
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-03-04 20:47:06 +00:00
Herb Derby
40a9061203 rename GrSDFTOptions to GrSDFTControl
Change-Id: Ie03fce7a99a9f71b18d54e3cd35e7675fb7f8912
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379616
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-03-04 19:49:10 +00:00
Herb Derby
4b1fb7ca90 cache the creation of one GrAtlasTextOp
GrAtlasTextOp has a high probability of being merged with the
previous op. This cache keeps using the same op to merge with
keeping memory warm.

This show about 5.75% improvement in skpbench on desk_nytimes.

When compiling for ios 9 or earlier, this optimization is
disabled.

Change-Id: I13ccbef6dcd4b9d82103bf20bba7d94f3e4fb6f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376718
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-03-04 18:45:59 +00:00
Mike Klein
b2045a3461 make runtime effect caching opt-in and private
We don't need to force public API users into using our cache; they can
cache on their own however they like.  We also don't need to force
internal users to cache, though I suspect most will want to.

I've kept deserialization using the cache, since that's an API users
can't reasonably cache themselves.  Though that's another area to expand
into, hooks for serialization and deserialization, that sort of thing.

Change-Id: I1496b193576b68c88be1dccd30d971cced54b340
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379599
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-03-04 18:24:30 +00:00