We now search for a block of N adjacent registers that minimizes the
number of spills, where unspillable registers are counted as if
infinitely expensive.
On arm64, store64 now uses alloc_tmp(2) and st2.4s, and similarly
store128 uses alloc_tmp(4) and st4.4s.
For the purposes of arm64 instructions we could allow the block to wrap
around the register file mod 32, but I figured that probably wasn't
necessary and might be confusing to follow. If we're right on the edge
some day we could circle back.
I'm not sure yet if our register-pair use cases on x86-64 will ever care
that the registers are adjacent, but it doesn't hurt to start that way.
This should behave pretty much the same when N=1 except that we're not
doing any interesting tie-breaking when all registers are occupied. I
left a TODO, but I bet we'll never feel the need to follow up on it.
Change-Id: Ibbdd42858a6daf61401c638435617bfb37d1899c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357300
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This will allow us to load these inputs for unit testing in `dm`.
Change-Id: Id256ba7c30d3ec94b98048e47af44cf9efe580d5
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357282
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Previously, the script was hardcoded to use the input file's path, plus
"/golden/". In a followup CL, we are going to move the input files into
the resources/ directory but keep the output files in tests/, so we
needed additional flexibility here.
Change-Id: I8d5a78f6a8efd9a0e7f2a6d1ad8ad72a46cf70ce
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357280
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
A passing test returns solid green. Failing tests are written to
return solid red, but drawing any other color than green can be
interpreted as a test failure.
Additionally, tests which cannot compile as RuntimeEffects (due to
non-ES2-compatible features) have been split into an ES2-compatible part
and an ES3 part.
Change-Id: I3f53121d9de0ae4c4e7f1de3177d067811980b55
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356999
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This allows us to roll the Parser back to an earlier state if we need
to do so. This includes:
- rewinding the lexer
- restoring the previous Pushback node
- backing out AST nodes
- backing out errors
This functionality is used to back out of parsing a vardecl if we
discover mid-stream that it is actually an expression statement that
coincidentally starts with the name of a type.
Change-Id: Ia5feb45019693931c1e6870e3ff7a5398924c863
Bug: skia:11198
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356997
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
The lexer can be reset to an earlier state simply by overwriting its
offset to a previous position.
Change-Id: I571c7981dbec3c43a894fe599f2e2a167bc380df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356976
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This should not cause any functional changes, and is just a prerequisite
for upcoming DSL work.
Change-Id: Iea165d3b7ede39ccc9cf5f5d78f623bc883b391e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356816
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Change-Id: Ib150e6d6d3de34a85ce8051eea843ab3b2d7ab75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356921
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Also cleanup some of the duplicate code in SkRecords
Bug: skia:7650
Change-Id: I4d3167a892c126c19a54002beab25c9a6c96fa5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357000
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
f0286e6364..ff5f715e5c
2021-01-22 stevenan@google.com Properly fail upon program binary version mismatch
2021-01-22 timvp@google.com Capture/Replay: Capture all indexed buffer bindings during MEC
2021-01-21 cnorthrop@google.com Tests: Add Subway Surfers trace
2021-01-21 timvp@google.com Vulkan: Flush if sync object is pending during SyncVk::getStatus()
2021-01-21 timvp@google.com Capture/Replay: Erase texture from mCachedTextureLevelData
2021-01-21 penghuang@chromium.org Do not make context current during context deletion.
2021-01-21 syoussefi@chromium.org Vulkan: Remove swiftshader workaround for missing gl_Position
2021-01-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 3180f85f9bcd to f646afdb8929 (2 revisions)
2021-01-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 132575638f37 to 67fb6a8435bb (480 revisions)
2021-01-21 syoussefi@chromium.org Translator: Avoid vector copies with multi-replacement
2021-01-21 timvp@google.com Vulkan: Move Flush during SyncHelper::clientWait() earlier
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 scroggo@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: scroggo@google.com
Test: Test: CopyOutputScalingPixelTest.ScaledCopyOfDrawnFrame/48Test: Test: FenceSyncTest.BasicOperationsTest: Test: angle_perftests --gtest_filter="*subway_surfers*"
Change-Id: I3fecd794cc100839fbe3853b49e86feb3b449383
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357007
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Rather than copying these triangles twice, we can run "pathToPolys"
during onPrePrepare and "polysToTriangles" during onPrepare.
Also adds a benchmark for normal and inner-fan triangulation.
Bug: skia:10419
Change-Id: Id301afde5de11d93ae026e75e42ac03a50867687
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355177
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This was the last remaining user of ByteCode. The skvm solution
is faster, and lets us delete the ByteCode system.
Testing on 15 instances of sinusoidal_emitter (90k particles):
- ByteCode ~9 ms
- ByteCode (older, optimized): ~5.5 ms
- skvm ~2.1 ms
Change-Id: Ia2e5c9ab2d36c97e59af28a6f989bf212889e439
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356919
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Like _globals, it's not actually necessary to indirect through a
separate pointer at all. The output struct is now passed by reference
and the additional pointer variable is removed.
(Additionally, renamed _skGlobals back to _globals.)
Change-Id: Id089a20cb751cdaedc48462a52da78ee43783611
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355632
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
I think it makes sense for the class functions to not have internal side
effects. Meaning, you can call pathToPolys and polysToTriangles all you
want without worrying about internal state.
Bug: skia:10419
Change-Id: I5e2136719bbf65a6a8e4c032c1c1326f0a9a98c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356496
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Replace "pathToTriangles" with "pathToPolys, polysToTriangles". This
will allow the tessellator to do pathToPolys in onPrePrepare and
polysToTriangles in onPrepare.
Don't make countPoints and polysToTriangles virtual. This is a step
toward moving the outer mesh of GrAATriangulator back out of the
class, which seems to match the style better.
Bug: skia:10419
Change-Id: Id6d22dcc2da0af84b9cb46fb36ead4c2e30d5c32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355176
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This GM tests out the GrTextureEffect with non-normalizable textures.
Change-Id: I5b0ffc43241a29d64516d07a4388668f224ffefe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355676
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
The basic problem was that WasmContextInfo shadowed non-virtual members
of ContextInfo. the tests, which work with that type, end up calling the
super class's methods which return null for directContext()
The context created and stored in WasmContextInfo would have worked if it
could be returned, but I've opted to go with what looks like a more
canonical way to test a new backend, that is to create a platform-
specific subclass of GLTestContext, and let GrContextFactory create the
GL context.
Bug:skia:10869
Change-Id: Ie9e1142cf2e7268242ff9aab70f76151714850a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355116
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
- Allow resolving inputs without modifying their colorspace
- Add helper to get the colorspace of a particular input
- Make resolveColorspace() virtual and add filter context to its
signature
Bug: skia:10841
Change-Id: I2e226ec26205f527c2d171140072f106ec35fbe0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356416
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
The SPIR-V code generator would sometimes invoke helper functions in an
unsequenced way, causing the output to vary across different compilers
or optimization settings. This CL explicitly sequences these operations,
which should make the output consistent across platforms.
Change-Id: Iaaf75b80e7495768d73dd6afa5b6d03f9cf3f262
Bug: skia:11175
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356844
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>
Just more internal cleanup/reorg, including passing around the (few)
fields we use from paint, rather than an entire paint, in the legacy
shader context. This was motivated (partly) to ensure that we don't
accidentally refer to getFilterQuality() downstream.
Bug: skia:7650
Change-Id: I69031dcb74e02c77bc4d6166fdb377262ae77046
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356842
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
I wrote this looking for places where we treat w differently from z.
None of these are an urgent problem today, but 2) could become one, and
all good to fix if only for consistency.
1) Recycle w's register when it dies in the interpreter.
If we don't recycle w's register slot when w dies, we'll keep
thinking w's alive and keep that slot around in case it's used.
This is only an inefficiency, but nice to avoid when we can.
2) Don't allow spilling w when looking for an unused register.
This is a JIT bug fix, avoiding the possibility of clobbering w with
dst(),x,y,z or a temporary when we need to use it. Doesn't look like
it's happening today, but could sneak in.
3) Allow aliasing w and dst().
This is for completeness, moot today... store128 is the only op using
w and doesn't use dst(), let alone try to alias them.
Change-Id: I1f22e67f8793be018282bc3e793412e1d1abd7a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356797
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This isn't really how I intended to use these, but we might as well
check if the registers happen to already be lined up how we'd like them.
And it happens quite often... I didn't gather detailed numbers, but both
sides of the "are we lined up?" conditions are being hit lots and lots
of times, in both store64 and store128.
Also rewrote the scalar flow of store128 to mirror store64. The old
code was just fine, but this makes it easier to follow the conditions of
when we can use st4. (This does remind me that we could also use
single-lane st2/st4/ld2/ld4 instructions to handle the scalar paths.)
Change-Id: Id2c94f68e5ea14031f7a23bdc76583dff4a7b65f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356436
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This should be the same amount of work in Assembler::bytes()
with one fewer field to track... might as well!
Change-Id: I54ca919983f11d218255817dbc4db292e7972409
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356796
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
We use our own custom lexer now.
Change-Id: I6a2a408094ba37c2eef7092f5a5caa107938613b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356476
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This simplifies our world and opens the door for more optimization.
Bug: skia:10877
Change-Id: I3c721f12a23bfa73dbdf1e02d9c77d7c6a889aa0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356309
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Without the "spawn another effect" binding (that was recently removed),
these serve no purpose.
Change-Id: Ica8cc3f444c6b749c634c41453501edfff9d9a23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356417
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This is a reland of 97c476ecb7
Original change's description:
> Disable the MSAA atlas mode for CCPR
>
> We have a long term path rendering plan that uses dynamic MSAA instead.
> This CL is a test to see if we can drop support for CCPR now.
>
> Change-Id: I1bff3ca3143a6b453b65a7932a1805c195922805
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354036
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Change-Id: Ied3390d7df0b01d5e9d565247f5aed0addb5ab8f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356336
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We were replacing points with the intersection of opposite edges.
Because of the distance tolerance we're using that may fall outside
of the original quad. Detect those cases and use averages of
intersection points instead.
Bug: chromium:1167277
Change-Id: I36b172f19339839bb21c060ddfe8109c184e9327
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356311
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
store64 and store128 will use the st?.4s instructions,
and load64/load128 the ld?.4s. The tricky bit for both
of course is that they load and store more than a single
register, and that those registers need to be adjacent.
Change-Id: I613d06cbcc6e00bfc16b1a2c88412dbbbb1c55ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356344
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
The previous implementation assumed that SkSL expressions do not have
side effects and so treated either side of a Boolean expression as
short-circuitable. That is, `foo() && false` and `false && foo()` would
both be optimized to `false`, eliminating the `foo()` call.
We now check for side effects first. An expression like `expr && false`
can only be optimized to `false` if `expr` has no side effects. (If
`expr` does have side effects, the expression is left as-is.)
Change-Id: I473cf026a8afe35d6a8d9518498f2b26d8996e60
Bug: skia:11162
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356357
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>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>