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>
Additionally, restructure the unit test to return a color (green for
pass, red for fail).
Change-Id: Ib1bb6bd8771c72cc751d8d2c65cc14a693166d4c
Bug: skia:11112
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356301
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>
Change-Id: I81c9a6ddcd65d40ebced18c7cfb1cad51066ba7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356297
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
No longer used and troublesome to use, so remove.
Change-Id: Idad9dd3325443f7e546465abf551de9784d9f829
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352512
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
external callers
This should not result in any functional changes.
Change-Id: I5ef0301cf63bee561871c0110fda2692849b53d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356102
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
The inliner can generate slightly tighter code if we avoid creating
helper variables inside a scoped block. This saves one temp variable
copy.
Change-Id: Iea9ecda24fa296eb489166887fd8ab50ec7176e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355982
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
No functionality changes, but the new variants of the methods make them
more accessible from upcoming DSL code.
Change-Id: Iaa9f1fab31cb7db00007b00d7d3b88ff5b9696b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356103
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This exposed a preexisting error: GrGrSLTypesAreSupported.fp used non-
square matrices, which are not actually present in GrSLType. The test
has been updated to use square matrices.
Change-Id: Ib51141cc14a0c3fcd1c3c3abf378f190d457b95f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356077
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We already had support for &&, ||, ^^ but somehow the common cases of
== and != were not implemented in the constant-folder.
This CL also updates the test to return a green/red color on success or
failure, instead of assigning arbitrary numbers into sk_FragColor that
don't mean anything. The long-term plan is to signal success or failure
of each test by color code; we can display these colors as swatches in a
GM slide for testing purposes.
Change-Id: I0810108b3c6b656a60cd8aa64ceefd765eff0157
Bug: skia:11112
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355984
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
81430e11c8..382f016dd3
2021-01-20 syoussefi@chromium.org Vulkan: Retain OpSource in SPIR-V
2021-01-20 enga@chromium.org Revert "Add support for building in Flutter Windows UWP configuration"
2021-01-20 timvp@google.com Tests: Add Klondike Adventures trace
2021-01-20 vantablack@google.com Multithreading in D3D11 minimum viable product
2021-01-19 syoussefi@chromium.org Add a helper ShaderVariable method to facilitate member rename
2021-01-19 jmadill@chromium.org Capture/Replay: Serialize float states properly.
2021-01-19 syoussefi@chromium.org Suppress failing tests on mac ARM
2021-01-19 jmadill@chromium.org Vulkan: Support GL_EXT_tessellation_shader.
2021-01-19 m.maiya@samsung.com Vulkan: Add integer type incomplete texture tests
2021-01-19 cnorthrop@google.com Tests: Add Asphalt 8 trace
2021-01-19 syoussefi@chromium.org Fix image bindings with an image after an image array of array
2021-01-19 jmadill@chromium.org Test Runner: Prevent race by not resetting timeout.
2021-01-19 cnorthrop@google.com Capture/Replay: Use glUniform1iv on samplers, ignore images
2021-01-19 jmadill@chromium.org Implement shader compiler changes for Tessellation.
2021-01-19 cnorthrop@google.com Capture/Replay: Fixes for compressed texture cache
2021-01-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 2bb77d70cc64 to dd50a3bce3ca (3 revisions)
2021-01-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 149733cead63 to 8da0f82baf35 (2 revisions)
2021-01-19 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 55486659cf9b to f3626a1bfa8f (232 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 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: Aztec Ruins MECTest: Test: Fortnite MECTest: Test: angle_perftests --gtest_filter="*asphalt_8*"Test: Test: angle_perftests --gtest_filter=TracePerfTest.Run/*klondike_adventures*Test: Test: dEQP-GLES31.functional.tessellation.*
Change-Id: I9d9a011ac71916c6bcaf81a7074849b928a42407
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356159
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Migrate clients to use drawImage(... sampling)
rather than relying on paint's filter-quality.
This CL just gets started, introducing the build-flag.
Bug: skia:7650
Change-Id: I4afdd964c6f805058afee0a8f3a6887d501ad42b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356076
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
store128() has been lowered into SkVM Ops strangely (two interlocking
64-bit stores) only because of SkVM's limit of three arguments per Op.
With four arguments we can lower store128() in a straightforward way.
Perhaps surprisingly, I've left the implementations of store128 fairly
naive, with narrower stores than having all this data together in one
place allows. I do want to follow up here, but not so much because the
speed of store128 is important, rather more so because getting the tools
in place for idiomatic store128 implementations will lead us down a path
with great knock-on effects for more interesting features.
We'll need four adjacent temporary registers to use the ARM-idiomatic
st2.4s/st4.4s approaches for store64/store128, and the idiomatic x86
implementations need multiple temporary registers too. Once we're able
to manage multiple adjacent registers as a unit, we'll be able to
stretch the idea to things like load64/load128 returning 2 or 4
registers worth of data from a single Op. And the ultimate goal is in
Half-is-fp16 mode, where we'll be able to fill one register with 16-bit
float/int/mask data and spread any 32-bit data across a register pair.
Change-Id: Ieb20d8b7d00e9d806cb27fd30ebfd50ae9317da7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355936
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
These types are supported by SkSL but were mysteriously absent from
GrSL.
Change-Id: Id3479a23b1ddee0604362ed8c12da0eea7c6fa56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355981
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This clip code will be shared with direct-to-op text drawing
path.
Change-Id: I6744a93cb75b555e91b3b016d5604d3ba81b02fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355977
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>