Commit Graph

53938 Commits

Author SHA1 Message Date
John Stiles
a0e56e3647 Allow ProgramVisitor::visitStatement to receive SwitchCase statements.
The original dispatched all the SwitchCase statements from within the
Switch handler. This splits it apart, so that individual SwitchCases can
be handled in a ProgramVisitor subclass' `visitStatement`. No existing
Analysis passes look for SwitchCase statements (they weren't sent!) so
this is currently a no-op change. This functionality will be used in a
followup CL.

Change-Id: I4c18cf4f67130df7e37a4d78a7d1d584764d75ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378780
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-03-04 15:14:29 +00:00
Brian Osman
48d7f7ca20 Add new style key information to several core effects
Covers some common geometry processors, texture effect, etc.

This also rearranges how fp keys are arranged in the overall key. We no
longer include the key size as part of the key - this made no sense.
Instead, we explicitly include the number of children. We also put all
data for one fp before any children, so the tree can be reconstructed
more-or-less top-down.

Finally, added an "addBool" helper that reads nicer than addBits(1)
everywhere.

Bug: skia:11372
Change-Id: I4e35257fb5923d88fe6d7522109a0b3f4c4017d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379059
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-04 14:49:07 +00:00
Robert Phillips
962708fbb9 GrGlGpu::ProgramCache no longer holds a GrGlGpu back pointer
In the threaded compilation world, the GrUtilityContext active on
a given thread will have to be passed in to the cache.

Change-Id: Id4f59b2e710080ab808275aeb2ffbcab38b3eadc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379061
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-03-04 14:29:57 +00:00
Mike Reed
b9bd12d6f8 Clarify how we decide the bitdepth for picture-shader
Change-Id: I6dafe3ec3cac988fd1bc6f97e2c0fc5c251a2d15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379296
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-03-04 14:28:16 +00:00
Adlai Holler
55aaefe687 Reland "Support sharing promise images between DDLs"
This reverts commit 38b9a4bc3e.

Reason for revert: Fixed ASAN, TSAN, and other bugs via other CLs.

Original change's description:
> Revert "Support sharing promise images between DDLs"
>
> This reverts commit 07e11d48cb.
>
> Reason for revert: Broke DDL3_ASAN and DDL3_TSAN
>
> Original change's description:
> > Support sharing promise images between DDLs
> >
> > - Migrate our code to SkImage::MakePromiseTexture
> > - Have DDLTileHelper share one SKP and one set of promise images across all tiles.
> > - Disallow on-the-fly allocation of mips for promise textures.
> >
> > Bug: skia:10286
> > Change-Id: Ie35976958454fc520f3c9d860e6285441260c9f7
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291938
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,adlai@google.com
>
> Change-Id: I939b14875d1a20e4a92eab94680adcfe9596ad81
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10286
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375738
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>


Bug: skia:10286
Change-Id: Ibfd7dfcd72f10a4e29a87fa8c610f2dfd018e0db
Cq-Include-Trybots: luci.skia.skia.primary:Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL3_ASAN,Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-DDL3_TSAN
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375739
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-03-04 13:10:37 +00:00
skia-autoroll
4b9f428b12 Roll ANGLE from 1de8b5a697e7 to 90db604919ba (11 revisions)
1de8b5a697..90db604919

2021-03-03 syoussefi@chromium.org Vulkan: Workaround Overlay draw issue on Android
2021-03-03 senorblanco@chromium.org Fix for readPixels() to PBO fast path.
2021-03-03 cnorthrop@google.com Tests: Add Rope Hero: Vice Town trace
2021-03-03 penghuang@chromium.org Workaround a GL_OES_depth32 bug on Android emulator
2021-03-03 lexa.knyazev@gmail.com Update DEP actions for Python 3
2021-03-03 cnorthrop@google.com Tests: Skip car_parking_multiplayer on Nvidia
2021-03-03 syoussefi@chromium.org Overlay: Widget for vk::DynamicBuffer allocations
2021-03-03 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 2a5fa9108962 to 143c12daa39f (878 revisions)
2021-03-03 jonahr@google.com Skip TransformFeedbackTest.MultiContext on Metal
2021-03-03 cnorthrop@google.com Tests: Add Talking Tom Hero Dash trace
2021-03-03 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 64e40ae7572f to 6c3f8d8c39b9 (7 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 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: angle_perftests --gtest_filter="*car_parking_multiplayer*"Test: Test: angle_perftests --gtest_filter="*rope_hero_vice_town*"Test: Test: angle_perftests --gtest_filter="*talking_tom_hero_dash*"
Change-Id: I6c1296fa95190f34d3deec978f3fe025460f34a8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379360
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-04 05:24:56 +00:00
skia-autoroll
21c8ad62cd Roll Dawn from f9d75ead9e2d to 637d947937b7 (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/f9d75ead9e2d..637d947937b7

2021-03-03 senorblanco@chromium.org Roll third_party/angle/ 0e11e49d1..d8557cc88 (25 commits)
2021-03-03 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from e879143801a1 to ec44eef965b6 (5 revisions)
2021-03-03 rafael.cintron@microsoft.com Protect Texture::DestroyImpl against multiple calls for D3D12
2021-03-03 enga@chromium.org Add XlibXcbFunctions to the CMake build

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

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: I3f534115974387c37916fefaf69dcb01576a9419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379376
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-04 05:02:57 +00:00
skia-autoroll
f3a46451ad Roll SwiftShader from 106e01583a3a to 084529f3a9b9 (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/106e01583a3a..084529f3a9b9

2021-03-03 venni.ihanakangas@siru.fi Add support for internal error status checking in regres

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: I4f61af1f42bcdca000aab2eb29d48c62bb7843b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379359
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-04 04:55:26 +00:00
Adlai Holler
4db5726495 Bail if context creation fails in FuzzDDLThreadingGL
Bug: oss-fuzz:31634
Change-Id: I9717d04d391c584f28d415fa728c7296edb91723
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379038
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-03-04 03:50:26 +00:00
Herb Derby
e4ef35caa1 add matrix compare to text blob key
In multi-threaded use, the cache would return a blob with direct
sub runs without comparing matrices. If two direct blobs have
different matrices, then they are incompatible. The original
code would find that the blob did not exist in the cache.
It would then make a new blob and insert it into the cache.
During that time, a different thread would create an
incompatible blob and insert it into the cache. The original
thread would insert the new blob into the cache, but the cache
finding an existing blob would return the incompatible blob.

The solution was to make the matrix, and drawing type part of
the key. Now, only compatible blobs are returned from the cache.

Change-Id: I318c756f07c84dd48b353b25639f9dcbe80c7b4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377976
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-03-03 22:25:56 +00:00
John Stiles
4633c9149b # Enter a description of the change.
Reland "Migrate if-statement simplifyStatement logic to IfStatement::Make."

This reverts commit 7e685f0377.

Reason for revert: fixed SkSLBench perf test

Original change's description:
> Revert "Migrate if-statement simplifyStatement logic to IfStatement::Make."
>
> This reverts commit e4da7b672f.
>
> Reason for revert: breaks SkSLBench perf test
>
> Original change's description:
> > Migrate if-statement simplifyStatement logic to IfStatement::Make.
> >
> > This performs essentially the same simplifications as before, just at
> > a different phase of compilation.
> >
> > Change-Id: Ia88df6857d4089962505cd1281798fda74fd0b02
> > Bug: skia:11343, skia:11319
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376177
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
> > Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
>
> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
>
> Change-Id: I0051188ffe69426904066eb60a932435efdc2af8
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11343
> Bug: skia:11319
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379062
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Bug: skia:11343
Bug: skia:11319
Change-Id: I74cc3295004133e9fdcf16e388106eb83603f526
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379063
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-03 22:21:36 +00:00
John Stiles
50b1b2b90d Disable control-flow analysis in SkSL. (Performance experiment)
This CL will be used to test for potential performance regressions (or
improvements?) that we might incur by disabling this optimization pass.

It will be reverted in ~1 day.

Change-Id: I775cdb0c95df81fa25ebbd66e4ff01f64c660f68
Bug: skia:11319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378456
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-03-03 22:08:56 +00:00
Jim Van Verth
84ded4d46c Implement GrMtlGpu::compile().
Revises how we build/find GrMtlPipelineStates to no longer be dependent
on GrRenderTarget.

Change-Id: I54abcc3a28505ae4ef6e1944f839fbe78d28cf7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379058
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-03-03 20:50:39 +00:00
John Stiles
7e685f0377 Revert "Migrate if-statement simplifyStatement logic to IfStatement::Make."
This reverts commit e4da7b672f.

Reason for revert: breaks SkSLBench perf test

Original change's description:
> Migrate if-statement simplifyStatement logic to IfStatement::Make.
>
> This performs essentially the same simplifications as before, just at
> a different phase of compilation.
>
> Change-Id: Ia88df6857d4089962505cd1281798fda74fd0b02
> Bug: skia:11343, skia:11319
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376177
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>

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

Change-Id: I0051188ffe69426904066eb60a932435efdc2af8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11343
Bug: skia:11319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379062
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-03 20:50:37 +00:00
Brian Osman
4c5943781e Emit new style key information in generated effects
All layout(key) fields include the field name meta-data, and use as few
bits as possible.

Bug: skia:11372
Change-Id: Ie12b3e0d01148457e5ea078cbf7d0a4bff35302e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378596
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-03 20:39:36 +00:00
Brian Osman
9e1ef99d1e fm: Make --writeShaders dump fragment, vertex, and key files
Bug: skia:11372
Change-Id: Ib764b8d995655317e8968e57b1ea0528339d430b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379060
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-03 20:10:06 +00:00
Mike Klein
dc41f59b3d update FM service account
We're not compiling, so definitely don't need that, right?
I do eventually want to upload from these tasks to Gold.

Change-Id: Ia6bac7e38c6a264f2f93cebd9746e4aaed9f4b5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379003
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2021-03-03 20:01:39 +00:00
Brian Osman
db6ad656ee Add Enum::foreach(), change EnumValue to return SKSL_INT
This gives a nicer interface (name + SKSL_INT) to getting all the values
of an enum (rather than iterating over the symbol table). Will be used
in a follow-up CL.

Change-Id: I1c104623bd06f770c57b88ca9996d3e8c87a3ca7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379057
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-03-03 19:29:36 +00:00
Mike Klein
46d9bb255d do not b.expiration(...) for FM
Caveat: I don't know what expiration is, except it makes bots go purple.

It looks like the default is 4 hours, and the DM and Perf bots set their
expiration even higher than that, 20-48 hours.  (Similarly, they set
higher timeouts than default, where FM uses the default.)

I figure I might as well move expiration up to the default, and then if
tasks are still expiring, start marching them up towards DM/Perf tasks.

Change-Id: I35dbd8ed8939cc6a62240947120858ba186c86b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379000
Reviewed-by: Weston Tracey <westont@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-03-03 18:41:28 +00:00
John Stiles
e4da7b672f Migrate if-statement simplifyStatement logic to IfStatement::Make.
This performs essentially the same simplifications as before, just at
a different phase of compilation.

Change-Id: Ia88df6857d4089962505cd1281798fda74fd0b02
Bug: skia:11343, skia:11319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376177
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-03-03 18:12:35 +00:00
Brian Osman
f0de96f7b8 Reland "Redesign program key construction"
This is a reland of bbbf1a7f50

Original change's description:
> Redesign program key construction
>
> This does two things:
> 1) Moves responsibility for bit-packing portions of the key into the key
>    itself. A new GrKeyBuilder type manages adding bits, with asserts to
>    ensure a value always fits in the requested number. In theory this
>    will let us generate smaller keys overall, at the expense of slightly
>    more complex code during construction.
> 2) Adds a string label parameter for key methods that fold in data. For
>    new methods, the label is required. To ease migration, the old add32
>    does not require a label (yet). This will let us generate detailed,
>    human readable keys, either based on SK_DEBUG, or a runtime option
>    (if we're comfortable paying the cost).
>
> Bug: skia:11372
> Change-Id: Ib0f941551e0dbadabbd2a7de912b00e9e766b166
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377876
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:11372
Cq-Include-Trybots: luci.skia.skia.primary:Test-Win10-MSVC-Golo-GPU-QuadroP400-x86_64-Debug-All-Vulkan
Change-Id: I179ed581bc9ba772191e727274ac0ac6979ebdf3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378778
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-03 17:44:00 +00:00
Robert Phillips
ae67c52933 Add GrThreadSafePipelineBuilder
GrThreadSafePipelineBuilder is the generic, base object the
GrContextThreadSafeProxy will hold. Each backend will create a
backend-specific version that is shared between the direct context
and the (possibly many) utility contexts.

Right now GrThreadSafePipelineBuilder just holds the pipeline
creation stats. Relatedly only GrGLGpu::ProgramCache and
GrVkResourceProvider::PipelineStateCache currently derive from
the new class (since they are the only backends that generate
pipeline stats).

Change-Id: I58f441c5c2b870bb5970c29cba19d1775864d52e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378320
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-03-03 16:44:21 +00:00
John Stiles
2dda50dd50 Add return-value check to the function finalizer.
Rather than have the inliner own this responsibility, the function
finalizer now detects if a function is supposed to return a value but
never actually does. This will allow us to detect this error case even
if the inliner is disabled. The inliner should no longer encounter
functions that claim to return a value but don't, so it will now assert
if one is encountered. (The inliner still has the logic to handle this
case gracefully, just in case.)

The check is currently very simple and doesn't analyze the structure of
the function, so it won't report cases where some paths return a value
and others don't, e.g. this will pass the test:

    int func() { if (something()) return 123; }

(This is good enough to resolve the inliner issue, though, as it only
occurred in functions with no value-returns at all.)

Change-Id: I21f13daffe66c8f2e72932b320ee268ba9207bfa
Bug: oss-fuzz:31469, oss-fuzz:31525, skia:11377
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377196
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-03-03 16:29:22 +00:00
Brian Salomon
874b3fb3c5 Add more clarity to why we use GrWrapCacheable::kYes in AHWB generator.
Change-Id: Ica5542466ef8db1c72506edebd1360b27e65dab6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378779
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-03-03 16:15:51 +00:00
John Stiles
23521a8d69 Add Convert factory function to SkSL IRNodes.
SkSL IRNodes now have two different factory functions:

XxxxxStatement::Convert -- this is the equivalent of
    IRGenerator::convertXxxxx. Type coercion is fully supported. Errors
    are reported via ErrorReporter. Failure is handled gracefully by
    returning null.

XxxxxStatement::Make -- this is treated more like `new XxxxxStatement`
    but with optimizations applied. Types must already be correct.
    If the passed-in arguments don't make sense, errors are reported
    via SkASSERT. `Make` is always expected to return an IRNode--
    either exactly what was passed in, or an equivalent simpler form.

(In some rare exceptions, supporting Make was too difficult and is
not handled in this CL. Constructor was the biggest edge case; it
is extremely complicated [skia:11032], and supporting Make would require
duplicating most of its logic. It was too much copy-and-paste for me.)

Rationale for this change:

Originally, when the Inliner or Rehydrator would create an IRNode, it
would just allocate it via `new` or `make_unique` and take it as-is.
No error-checking, no optimization.

I decided to allow those callers to benefit from simple optimizations.
This meant porting logic from the IRGenerator (e.g. `convertIf`, which
removes empty branches) into widely available factory functions.
However, the Inliner and Rehydrator don't need the type coercion, and
we'd rather have them assert/succeed instead of getting a null and
crashing (in the unexpected case that recreating an IRNode causes an
error to be detected).

Change-Id: I6949328e904258a627106524ed4134b524e012b6
Bug: skia:11342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377843
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-03-03 16:13:41 +00:00
Greg Daniel
2c760cc913 Add MakeTexture factory to GrVkAttachment.
This adds the factory, but it is not used anywhere.

Bug: skia:10727
Change-Id: I94379598a2fbf488a36d44f21921289f9bf02823
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378378
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-03-03 15:26:21 +00:00
Adlai Holler
ba52c9165d Make GPU image lazy size calculation thread-safe
We also don't talk to the GrGpuResource if its been assigned,
because other threads may be querying this proxy for its size.

Bug: skia:10286
Change-Id: Ifd4fb8ca796143c7264554b0812910c88e32dcdd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376716
Auto-Submit: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-03-03 15:15:51 +00:00
Kevin Lubick
a1e30a3a28 [canvaskit] Update all demos to use full version from 0.25.0
Also add some explanation to the image_sampling demo.

Change-Id: Id20fe4d47c45b6a6b27e227871458bb862ec83d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378936
Reviewed-by: Mike Reed <reed@google.com>
2021-03-03 14:38:35 +00:00
Herb Derby
9ad09829f5 encapsulate GrSDFTOptions better
The logic for picking what type of sub run to create is spread
over several locations. Gather that altogether in drawingType().

Have GrSDFT close over all the data needed to calculate the
drawing type. This reduces plumbing to the processGlyphRun
routine.

The next CL should rename GrSDFTOptions to GrSDFTControl.

Change-Id: I99e74c11af6d3b3d9919e54fe1e7286fcfbf1bfb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378036
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-03-03 14:27:32 +00:00
Mike Klein
158cab563f track flags in a map
I got to thinking that seeing flags like,

    out/fm --nonativeFonts -b cpu --nativeFonts -s ...

is kind of confusing, and I'm also trying to figure out
how to identify these runs to Gold.  I think the answer
to both might be to track a map[string]string for flags,
allowing overrides rather than just appending, and then
that flag map ends up being the identifying properties.

Change-Id: Ie5f80ee8b145c205edc768ae871eb70a3e1bc5b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378355
Reviewed-by: Eric Boren <borenet@google.com>
2021-03-03 14:22:16 +00:00
Brian Salomon
6d25f9d068 Fix downsampled blur with clamp mode.
Ensure the extra border added to the downsampled image doesn't filter in
values from outside the source bounds.

Bug: chromium:1174354
Change-Id: I6c62eeaa57ce4e5341eab24985553f87ab0df666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378322
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-03-03 14:15:31 +00:00
Adlai Holler
e1a728416c Enable reduceOpsTaskSplitting on select bots
This is a prep stage to get coverage of this option as we
move into Android code freeze.

This also removes the separate ReduceOpsTaskSplitting run from
the Pixel4XL. No need for it.

See skbug.com/10877#c27 for information.

Added this info to the Skia Gardener doc as advisory.

Bug: skia:10877
Change-Id: I69475f87b29aa125e285a8914015ac6a55e3390e
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Debug-All-Android_Vulkan,Perf-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_Vulkan_Skpbench,Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android,Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android,Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android,Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android,Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Debug-All-Android,Perf-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377856
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-03-03 13:58:31 +00:00
Brian Osman
acf26501fb Revert "Redesign program key construction"
This reverts commit bbbf1a7f50.

Reason for revert: D3D Failures

Original change's description:
> Redesign program key construction
>
> This does two things:
> 1) Moves responsibility for bit-packing portions of the key into the key
>    itself. A new GrKeyBuilder type manages adding bits, with asserts to
>    ensure a value always fits in the requested number. In theory this
>    will let us generate smaller keys overall, at the expense of slightly
>    more complex code during construction.
> 2) Adds a string label parameter for key methods that fold in data. For
>    new methods, the label is required. To ease migration, the old add32
>    does not require a label (yet). This will let us generate detailed,
>    human readable keys, either based on SK_DEBUG, or a runtime option
>    (if we're comfortable paying the cost).
>
> Bug: skia:11372
> Change-Id: Ib0f941551e0dbadabbd2a7de912b00e9e766b166
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377876
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I7bfb20905c87083e84a1ea21bc53d63e882e2c68
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11372
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378777
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-03-03 13:35:22 +00:00
skia-autoroll
73518c4ee9 Roll ANGLE from 6b6da203cce0 to 1de8b5a697e7 (8 revisions)
6b6da203cc..1de8b5a697

2021-03-02 cnorthrop@google.com Tests: Add Car Parking Multiplayer trace
2021-03-02 ynovikov@chromium.org Pull buildtools DEPS directly instead of via recursedeps
2021-03-02 cnorthrop@google.com Test: Add Standoff 2 trace
2021-03-02 j.vigil@samsung.com EGL: implement EGL_EXT_buffer_age
2021-03-02 lubosz.sarnecki@collabora.com capture_replay_tests: Fix MemoryObjectTest.
2021-03-02 lexa.knyazev@gmail.com Add Chrome Canary ANGLE injection steps
2021-03-02 jonahr@google.com VK: Suppress VUID-vkCmdBindDescriptorSets-pDescriptorSets-01979
2021-03-02 cnorthrop@google.com Tests: Add Among Us trace

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: angle_deqp_egl_testsTest: Test: angle_end2end_test --gtest_filter=EGLBufferAgeTestTest: Test: angle_perftests --gtest_filter="*among_us*"Test: Test: angle_perftests --gtest_filter="*car_parking_multiplayer*"Test: Test: angle_perftests --gtest_filter="*standoff_2*"
Change-Id: Ibce215bdc5a0a5b704950acbc7ff5e874bde33ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378818
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-03 04:47:29 +00:00
skia-autoroll
c2525a2776 Roll Dawn from fbda46da44a0 to f9d75ead9e2d (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/fbda46da44a0..f9d75ead9e2d

2021-03-02 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 5cfd4f5a073e to e879143801a1 (1 revision)
2021-03-02 senorblanco@chromium.org Skip SNORM formats on unsupported platforms.
2021-03-02 rharrison@chromium.org Add missed level value to textureLoad
2021-03-02 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 05d9bffdbda1 to 5cfd4f5a073e (7 revisions)

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from 05d9bffdbda1 to e879143801a1

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: Iea578aed3f9d66c33b44d72185c6ec361d1ee9cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378836
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-03-03 04:43:20 +00:00
Brian Osman
bbbf1a7f50 Redesign program key construction
This does two things:
1) Moves responsibility for bit-packing portions of the key into the key
   itself. A new GrKeyBuilder type manages adding bits, with asserts to
   ensure a value always fits in the requested number. In theory this
   will let us generate smaller keys overall, at the expense of slightly
   more complex code during construction.
2) Adds a string label parameter for key methods that fold in data. For
   new methods, the label is required. To ease migration, the old add32
   does not require a label (yet). This will let us generate detailed,
   human readable keys, either based on SK_DEBUG, or a runtime option
   (if we're comfortable paying the cost).

Bug: skia:11372
Change-Id: Ib0f941551e0dbadabbd2a7de912b00e9e766b166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/377876
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-03-02 23:46:48 +00:00
John Stiles
e80e169ba4 Add GetConstantValueForVariable to constant-folder.
This can be used in places which simplify an expression at IR generation
time. e.g. `const bool x = true; @if (x) {...}` could be evaluated at
compile time by calling GetConstantValueForVariable before checking for
a BoolLiteral and flattening the if. It is also used at the top of
ConstantFolder::Simplify to reduce either side of the binary
expression being simplified, in case it's a const variable.

We don't use a lot of const variables in our tests, but this does
improve the code generation in ConstVariableComparison.sksl
when constant-propagation is disabled: http://screen/gnWPhQG8Jc5cER9

Change-Id: I26309769cd16a6833b74b11a115b87c3dc312514
Bug: skia:11343
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378017
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-02 22:59:04 +00:00
Herb Derby
12e760e958 simplify check_integer_translate's API
Change-Id: I369ff838d0467b1447237c6721d4e380933f630b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378376
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-03-02 21:58:08 +00:00
Brian Osman
587efaeb15 Handle pipeline creation failure in Dawn
All other backends already have similar logic.

Change-Id: Idc8f1fe0839d5338f4832c04dd036accab20f156
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378457
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-03-02 21:56:48 +00:00
Greg Daniel
e0baf60910 Add Texture usage to GrAttachment.
This is not used anywhere yet, just starting to get the framework all
set up.

Bug: skia:10727
Change-Id: Ie321bb850e4c0eecd5e557b8a7828ee941ba7d2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378377
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-03-02 21:56:42 +00:00
Ethan Nicholas
4113057c57 Fix use-after-free in SkSL DSL
Bug: skia:11384
Change-Id: I462295ce8eb42ca5270595bbd8714d70abf33441
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378319
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-03-02 21:33:59 +00:00
John Stiles
46f4497cb6 Add const to SkSL layout keys.
This will allow @if statements to work properly with layout(key) values
even with control-flow analysis disabled.

Change-Id: Ib76b8c5553621815decda7fb0eefccb2c82df02b
Bug: skia:11319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378416
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-02 20:52:24 +00:00
Mike Klein
bc4a36af7c add --race to FM
Try to uncover races by running parallel replicas.

The default --race 0 should keep FM working as before, but now with
--race ≥2 we'll actively try to race replicas, syncing between tests.
--race 1 is almost pointless, just changing the thread tests run on but
without any interesting concurrency.

Rearrange a bit how fm_driver decides what flags to pass to which
invocations of FM, so individual runs can easily override defaults (e.g.
--nativeFonts overriding the usual --nonativeFonts).  Use that here to
set --race 0 for unit tests; many unit tests are not reentrant.

Change-Id: Ida451626c093793b0805d3036beb185e7d54f27e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376761
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-03-02 20:43:05 +00:00
Julia Lavrova
b7b9a23281 Treat control codepoints as resolved
The correct solution will be implemented to fix bug 11380.
https://bugs.chromium.org/p/skia/issues/detail?id=11380

Bug: skia:11370
Change-Id: I15a84e2e785d73a298558e5ef0dedcc69f7b6eef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376936
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-03-02 20:38:48 +00:00
Jim Van Verth
35906e0115 Store push constants setting in persistent cache.
When generating the SkSL for a given shader we've already made some
decisions about whether to use push constants or not. However, the
SkSL->SPIR-V generator needs to know this in case it adds a uniform
(namely RTHeight).

Change-Id: Id8767924fff4e01227aca5f6fd6f8d5386e357bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378321
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-02 19:29:07 +00:00
Mike Klein
6cac02f5c7 add missing failStep()
If a re-run fails today, that leaf exec.Run() step will fail, and its
grandparent (representing a giant bunch of sources and a set of flags)
fails, and the whole great-grandparent task fails, but the exec.Run()'s
parent (a small batch of those sources) stays green.

Here's a before-this-CL example:
https://task-driver.skia.org/td/y2nmMwJAyuK2kmCNGtrk?ifNotFound=https%3A%2F%2Fchromium-swarm.appspot.com%2Ftask%3Fid%3D520ccdac1ff16010

Here's one where the failures propagate up right, I think:
https://task-driver.skia.org/td/Gb2Pta6M2bZAJpQYvRXO?ifNotFound=https%3A%2F%2Fchromium-swarm.appspot.com%2Ftask%3Fid%3D520cfbaeb2f06010

I don't suspect anything's wrong beyond bookkeeping.

Change-Id: Ib138f62f6663bbba1804ccafb28756f8c4c4d3ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378401
Reviewed-by: Eric Boren <borenet@google.com>
2021-03-02 19:17:28 +00:00
Mike Klein
a9e62e893b add flags for clipping to FM
tabl_mozilla.skp is uselessly large without a clip.

Change-Id: I6e8ab8c31e790b6629be01e6eeb2e8d60c6ff56f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378360
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-02 19:06:24 +00:00
John Stiles
786d42c6da Improve comments for Analysis::IsSelfAssignment.
Change-Id: I34353769f4c65bdfa7205d460671a78f3463a5f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378317
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-02 18:05:03 +00:00
Nathaniel Nifong
036ba86489 Enable dithering in more situations by using raster pipeline
https://b.corp.google.com/issues/178474583

For a CPU backend, SkBlitter now tries to choose RasterPipelineBlitter
when the paint has isDither=true, because that blitter is better at dithering
than LinearGradient4fContext.

guarded by SK_USE_RASTER_PIPEPLINE_BLITTER_FOR_DITHER which will
be set on android.

Change-Id: I5201dc7243d80cfee822d775c673593d119f0b5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372557
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-03-02 16:56:23 +00:00
Brian Osman
dc4f8cd7ea Add early_fragment_tests layout qualifier to SkSL
Bug: skia:11356
Change-Id: I16322e6396dc7e7c8c50ba1d39e07311cf3bd346
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376116
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-03-02 16:45:03 +00:00