This node was only used to detect recursion while inlining. We no longer
need to do this, because we disallow recursion in all programs.
The removal of one IRNode per inlined function actually allows for
slightly more aggressive inlining, since we restrict inlining based on
IRNode consumption. This allows the "ExponentialGrowth" tests to inline
a bit more deeply than before.
Change-Id: I894dbb1ca3096bb785b67facb01cc9c630f694c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534780
Reviewed-by: Arman Uguray <armansito@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
The `wgpu::Device::Tick()` function is not available when the Dawn
backend is compiled using emsdk to target WebAssembly. As an
alternative, this CL introduces code that takes advantage of
emscripten's Asyncify feature to yield execution to the browser's event
loop and allowing it to execute async tasks from blocking Skia code.
* Introduced the GrDawnAsyncWait class which abstracts over Asyncify vs
wgpu::Device::Tick depending on the platform and implements common
busy-wait boilerplate.
* Refactored the fence management in GrDawnGpu to make use of
GrDawnAsyncWait. The GPUQueue.onSubmittedWorkDone is now handled by a
callback on GrDawnGpu instead of per-fence callbacks since the latter
cannot easily prevent a use-after-free if a fence is destroyed before
the callback runs.
Bug: skia:12512
Change-Id: I255e92ec87c799dc7a50bd034a815c0aaca0ef5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530736
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
Change-Id: I23b8c5a37a7ccaddccc042f8a4f70a2e29a41211
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535399
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This warning is about pre-C99 where declarations had to preceed
statements.
Change-Id: Ie029ebc0d2857d2d73c1395b8046e733765d8b17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535439
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Unsurprisingly, this makes more of the GMs and SKPs look correct.
It isn't added exactly as we would like going forward though. I
believe we would prefer something that munges the matrix and then
calls a child.
Bug: skia:12701
Change-Id: Ib50246a8d575a8a2489afdb7e5f6032a22637bd2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535116
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Change-Id: I9a5f3bc84cca209f914c7e40a5fbdc72f1460f47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535403
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:12701
Change-Id: Ia51c9086c20d28af2fea254658730d9bd4179605
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535396
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a reland of commit 9be2d572d4
Original change's description:
> Add anisotropic option to SkSamplingOptions.
>
> Implement on GPU.
>
> Bug: skia:13036
> Change-Id: I35d760596c4f8faaec27fccf284b70802fcf3f9b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524757
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13036
Change-Id: I3e411aae389dc880ce32bba78852705059fb88b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535197
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
To make it easier to use the G3 version of this dep,
we make a reference to it in the WORKSPACE.bazel, so
we can refer to this external dep with the @ notation.
I would like to do this for all of our third party
deps, but one at a time.
Change-Id: I03e0beca124225e0faf1232278dae641da8a3e4d
Bug: skia:13240, skia:13211
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535358
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Also updated the gn_to_bp.py to handle using the DEPSed vk_mem_alloc.h.
When rolled into Android we will copy the vk_mem_alloc.h from a local
DEPS checkout into a vma_android folder that will be checked into the
skia that lands with Android. We are using vma_android folder instead
of the current third_party/vulkanmemoryallocator folder because we
soon plan to move the latter into src/ instead of third_party. So just
using a different directory allows us to avoid doing an additional
change to the auto roller.
Bug: skia:13240
Bug: skia:13242
Change-Id: Ia344e13e3f7c7efecc2e6a97a96820f3ae58b5c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531318
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Generating unique names is expensive! The inliner does it a lot. There
are two pain points:
- Assemble a candidate name with String::printf
- Use SymbolTable::lookup to make sure that name isn't taken already
Previously, these steps took roughly the same amount of time on my
machine. Afterwards, SymbolTable::lookup takes the vast majority of the
time spent in uniqueName. (Further optimizing symbol lookup is a Hard
Problem--trying to design something better than the current
implementation in the general case is not easy.)
This change gives nanobench a 1-3% win on my Macbook Pro.
median mean
192µs 196µs sksl_medium (before)
185µs 189µs sksl_medium (after)
414µs 424µs sksl_large (before)
406µs 413µs sksl_large (after)
Change-Id: I8e0f7f053d124827a4d50a5006129e541a20c70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534520
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We no longer allow recursive code anywhere, so the inliner doesn't need
to guard against recursion.
Change-Id: I1cd39e215d0b93b8a5b578eb20854075f7e48ed5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534779
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: Ibc8bf4d49a020f20dfcc775fb4996558127ac830
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535123
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
We enforce no-recursion in all programs now, not just Runtime Effects.
Change-Id: I3737329e4526fa1b7fdbb47ccb959f78f507f665
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535119
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Previously, we allowed non-ES2 programs to contain recursion. However,
most GPU backends don't actually allow recursion at all. Now SkSL bans
it regardless of the strict-ES2-enforcement setting.
Change-Id: I572a30cafc39fe1791038a92d7e5c5d9bafa99aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534777
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This class manages and suballocates buffers used to upload textures. It
maintains a reusable, suballocated buffer for small allocations, and
creates dedicated buffers for any allocation larger than its set
reusable buffer size.
Change-Id: If7877faed870afbc85635ae47553000fa3487aba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534941
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: James Godfrey-Kittle <jamesgk@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
- Disables MSL via SPIRV (we don't have the necessary DEPS)
- Adds new context type, configs, etc...
- Minor tweaks to the ANGLE test context code
Bug: angleproject:7155
Bug: skia:13272
Change-Id: I258ed19abba01ad96cfe6fca46b558af2340880e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534569
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:13263
Change-Id: I1a1bff427964c9d0899a533ce7add1829e980c19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534566
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
The uniform was dependent on all paths, and patches, written from an
op's batch. But this isn't compatible with graphite's data flow since
the stroke render step would need to provide uniforms before sorting
that could produce an equivalent batch of paths.
That said, the only real limit on the vertex count is from the max
size of the vertex ID or fallback buffer. These are constants. Assuming
that the CPU computes the required segments equivalently to the GPU,
then we'd never apply the clamping under typical usage, since the
draw call would use just enough vertices anyways.
Bug: skia:12703, skia:13056
Change-Id: I708ef4bc48beb9c23cba6cba7930f05057b4c323
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530678
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This renaming makes the SnippetRequirementFlags just say what is needed.
Not how Graphite implements it.
Bug: skia:12701
Change-Id: I0506c55775c29c30d55c696c4c1f71e91156a5a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534761
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This referred to CCPR's atlas and is not actually related to the current
clip atlas. Nothing was checking for this cap, and my guess is it could
have been cleaned up when CCPR was removed.
Change-Id: If276a123a1d9ccf7301bf26f65ff3f4fbe97b3e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534521
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: chromium:1320216
Change-Id: I99117a02869ed861cc4b97796789268ccdc192c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534942
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
I just ran `go mod download`
Change-Id: Ic9b07bfa6da2e0c75e9f2580f8c71f23a361e6de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535117
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Bug: skia:13118
Change-Id: Ibfcc8df522a87f8ddf6e185121c0844d453b2012
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534139
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
I noticed the old version of cosine_between_vectors was causing issues
after https://skia-review.googlesource.com/c/skia/+/532014 landed, which
had the effect that tan0 and tan1 tended to be larger for lines.
That said, I could find instances of the same visual glitches on other
devices before that change landed, so depending on the hardware we were
running into issues either way.
This changes the cosine function to assume the tangents are already
normalized, and restructures the curve evaluation logic to assume that
as well. This is a reduction in work that hopefully makes up for the
work of always normalizing tan0 and tan1, whereas before the cosine_
function attempted to avoid that, and do a single inversesqrt call.
From a precision standpoint, just switching to calling normalize() on
tan0 and tan1 before getting the cosine improves the problem compared
to the precision required to store (dot(tan0,tan0)*dot(tan1,tan1))
before normalization. However, I also added some additional logic for
when coordinates get very large to try and scale the two end points of
the line to a more normalized exponent range. Since it returns the unit
vector, it should be equivalent but more accurate.
Bug: skia:11268, skia:12703, skia:13056
Change-Id: I34b6e1df1f57a8913443d75ed78710fcd27731e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532777
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Using memcpy gives the optimizer more latitude to do smart things.
SkStrAppendU64 already had memcpy here; I just copy-pasted the code
over from there.
Change-Id: Id63881122acf544cb4457e708438ffb14479abdc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534938
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
I had left these in as examples but we want to minimize data payloads.
Bug: skia:12701
Change-Id: I1fc6b882b9be98fe1c2ff6421a647116dbd431c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532764
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13263
Change-Id: I9bacd0551c0f6a2fd56ee9e0a961228642595426
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534199
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
This will let us use this utility everywhere.
Bug: skia:12701
Change-Id: I9342d0b40a81789ed93e3ec4009e5602033d6691
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534662
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>