This combines the BruteForceManager and Gridmanager, starting with
brute force when it's fastest for low N and then transitioning to less
accurate grid that scales for larger N.
Also updates the set of benchmarks to run based on more reasonable
configs (e.g. having a reasonable level of accuracy to be worth
considering).
Updates Device to use the HybridBoundsManager with brute force up to
64 draws, and then a grid configured to make 16x16 pixel cells. My
guess is we will see a mix of perf regressions and improvements with
this. The existing use of the NaiveBoundsManager had negligible CPU
cost but disallowed all re-ordering. The brute force and grid
managers will add CPU cost but enable re-ordering, which shows up
as shorter command buffers (e.g. 17k commands vs. 28k commands in the
motionmark suits benchmark). However, because we don't have SSBOs
there still isn't as much batching that would let the GPU take
advantage of this re-ordering so I'm not sure how visible the wins
will be yet.
Bug: skia:13201, skia:12787
Change-Id: Iad58fccab45def5f702a30860e063669424dfcf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550518
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Nicolette Prevost <nicolettep@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Added changes for public.bzl
This is a reland of commit 4a375fe213
Original change's description:
> Move SkSubRun to src/text
>
> Change-Id: I5c1040b8236dc792de20495a3fea3c0be6e31c20
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549847
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I86e342a416a3c97bf972c496b93b37e35cd09c19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550496
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
[[maybe_unused]] is built in to C++17.
Change-Id: I5e49d0801878fd9fbca62ab28080aa856e33ca79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550500
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
And a little bit of unit tests and benchmarking...
Change-Id: I56252846c2c00f35e70472e5d8272717d6ec4b25
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/545897
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: I5c1040b8236dc792de20495a3fea3c0be6e31c20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549847
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Label temprory offscreen textures for draws. In this CL, we will
label texture for a part of blur from SkGpuBlurUtils..
Bug: chromium:1164111
Change-Id: Ibfe1c16efa57b6a134a763bc918411108e286704
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549057
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This allows mskps produced with Chromium to be displayed in the
debugger. Previously, the debugger would produce invalid json if any
string contained characters which needed to be escaped. The debugger
also treated all strings like NULL terminated strings, but json is
Unicode based and code point U+0000 is a perfectly good code point.
Change-Id: I28150bad666b02be9f1e4af4078a4ca1e65bf000
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549098
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
In this CL:
1. Replace the empty label string with the label name for
different Skia components.
2. If the label string is empty, avoid sending it.
3. Append "_Skia_" at the beginning of the label string.
Bug: chromium:1164111
Change-Id: I8154f960591f0c001c6746f25e1939e0eb65d7fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548516
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
In this CL, the GrSurfaceProxy's and GrDrawOpAtlas's label strings
are plumbed so that it can be stored in the label string of
GrGpuResource. onSetLabel method, which is called from setLabel
method of GrGpuResource, will pass labels to Skia OpenGL backend
using ANGLE's labeling API.
Bug: chromium:1164111
Change-Id: I516c06f0ebbf6bbe6d31ea5a4a64b2baeedd1560
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/545717
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
SKPBench tiles the SkPicture into multiple surfaces, with tile WH
differing between GPU and CPU backends. Graphite was being incorrectly
classified as a CPU backend and ended up using smaller tile sizes, so
the SkPicture would be played back many more times relative to Ganesh.
In addition, each surface's contents is a subset of the total picture,
so batching was artificially limited compared to Ganesh.
Added a call to Device::flushPendingWorkToRecorder() in
Surface_Graphite::onFlush(). This ensures DrawPass::Make() is called
when nanobench and viewer are measuring the bulk of the work
(viewer's "flush" time was always 0 for Graphite since the
DrawPass::Make was only being counted in the total time when it
was executed for swapBuffers()). Flushing in this manner also prevents
batching across loops in nanobench, or resetting/clearing prior loops
recorded draws when the benchmark starts with a fullscreen clear.
The SKPBench change should make all graphite benchmarks report lower
times compared to what's in perf.skia.org. The flush change should
increase their reported times for benchmarks that required multiple
loops to get an accurate time measurement (for expensive SKPs with
loops == 1, it shouldn't be affected).
Change-Id: I9256dbfc4c7c021377be8f5137b48036cc67e4a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548157
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This CL also removes a few from SkSLUtil but the majority of these will
be cleaned up in a followup. (Some of these are currently in active use
in SkSL.)
Change-Id: I7a018d3f6d8d21d69805f91d81a49c09636e4661
Bug: skia:12559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/547818
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
In PDF there are two different physical encodings of strings (as a
sequence of bytes). There is the literal string encoding which is
delimited by '(' and ') which stores the bytes as-is except for '(',
')', and the escape character '\' (which can introduce octal encoded
bytes). There is also the hex string encoding delimited by '<' and '>'
and the bytes are encoded in hex pairs (with an implicit '0' at the end
for odd length encodings).
The interpretation of these bytes depends on the logical string type of
the dictionary key. There is a base abstract (well, almost abstract
except for legacy purposes) string type. The subtypes of the string type
are `text string`, `ASCII string`, and `byte string`. The `text string`
is logically further subtyped into `PDFDocEncoded string` and `UTF-16BE
with BOM`. In theory any of these logical string types may have its
encoded bytes written out in either of the two physical string
encodings.
In practice for Skia this means there are two types of string to keep
track of, since `ASCII string` and `byte string` can be treated the
same (in this change they are both treated as `byte string`). If the
type is `text string` then the bytes Skia has are interpreted as UTF-8
and may be converted to `UTF-16BE with BOM` or used directly as
`PDFDocEncoded string` if that is valid. If the type is `byte string`
then the bytes Skia has may not be converted and must be written as-is.
This means that when Skia sets a dictionary key to a string value it
must, at the very least, remember if the key's type was `text string`.
This change replaces all `String` methods with `ByteString` and
`TextString` methods and updates all the callers to the correct one
based on the key being written.
With the string handling corrected, the `/ActualText` string is now
emitted with this new common code as well for better output and to
reduce code duplication. A few no longer used public APIs involving
these strings are removed. The documentation for the URI annotation is
updated to reflect reality.
This change outputs `UTF-16BE with BOM` with the hex string encoding
only and does not attempt to fix the literal string encoding which
always escapes bytes > 0x7F. These changes may be attempted in a
separate change.
Bug: chromium:1323159
Change-Id: I00bdd5c90ad1ff2edfb74a9de41424c4eeac5ccb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543084
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Also cleans up the scattered references remaining in the code base
(including in files I thought I got already...).
Change-Id: I7004354b1e9cea9f9d9f45b791d8ab9ce557ba01
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/542647
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13118
Change-Id: Id7c92b2e1af9febb3e576c244fcff3aedd27f408
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/542646
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Change categorizeGlyphRunList to be static, and take the
strike cache as a parameter. This will simplify hoisting this
to the SkGlyphRunListBuilder.
Change-Id: I34b7d71aedc0dc67ae256d0121999fca2981a89f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541744
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I511f6105537b24953de1533ad7b73d1186afd4fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541060
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This feature is always disabled when DSLParser is used. Name mangling
was only useful when compiling hand-authored DSL code that explicitly
declared two variables with the same name in separate scopes. In
practice, as long as we aren't declaring complete programs in DSL form,
we don't need this.
Change-Id: Icad921eb86365b3b114ff1872b1c40c41470a4b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541637
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
ProgramSettings now has a fRequiredVersion, based on the #version
directive (if any). There is plenty more to do, and this is an
intermediate state where the "fEnforceES2Restrictions" bool still
exists. Eventually, that will go away, or change into a check between
the required version and the SkCapabilities supplied (also in
ProgramSettings).
As a proof-of-concept, this migrates some use-cases to insert the new
version directive, and unlock ES3 features in some tests and benches.
Bug: skia:11209
Change-Id: I964975931039588d7a302bfedd09246e3d4a79d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540037
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Remove the unneeded device information from the Painter. Flow
the device info where needed in the code.
Change-Id: I31f79979a0e8f4d41ea942ea9c7052fbe83cd330
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541059
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This is a reland of commit 167e608bb3
Original change's description:
> [infra] Remove old python scripts and urllib2 references
>
> I was searching for urllib2 while resolving issues with
> https://skia-review.googlesource.com/c/skia/+/538636
> when I found several old, apparently unused scripts.
>
> Rather than fix them, let's get rid of them. If they
> are still in use, the conversion to urllib.request is
> pretty easy.
>
> Change-Id: I27d419601e81c93a3d53e280188a379dfab927c4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538936
> Auto-Submit: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Ravi Mistry <rmistry@google.com>
Change-Id: I656b45cbcbde61c45d6d9daa0d6b97324d738631
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541077
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Auto-Submit: Kevin Lubick <kjlubick@google.com>
The conceptual meat of this change is that instead of taking a local-to-
device scale factor and the local stroke width, CalcNumRadialSegments
now takes the approximated device-space stroke radius. The main benefit
of this is that hairlines can be defined exactly without needing to
invert the local-to-device matrix or otherwise estimate a local-space
radius that would transform to the 1px hairline. The actual math for
regular strokes remains the same (scale factor * radius), but is moved.
In addition, this CL fixes a bug I had introduced in
https://skia-review.googlesource.com/c/skia/+/502059/
where I had not realized the CPU code operated on stroke *width* and the
GPU code operated on stroke *radius*, so updating them to use the same
equations w/o changing their inputs actually caused us to overestimate
the number of radial segments required. With this change, both the CPU
code and GPU code operate on stroke radius.
Between that bug fix and simplifying the hairline stroke radius math,
I am expecting lots of slight AA changes around stroked paths.
Lastly, I entirely removed the StrokeTolerancesBuffer, which was a class
that buffered up calculations of CalcNumRadialSegments by looking at the
entire list of paths in an op and putting them into a 4-lane SIMD
function instead. This isn't currently available for Graphite and makes
it harder to consolidate the radial segment calculations. Locally I
found no noticeable difference in the patch writing microbenchmarks
(where it would be more significant), and somehow the motionmark SKPs
were actually a touch faster. I'm hopeful that we can drop this
complexity and not take a large performance hit.
Bug: skia:13056, skia:13012
Change-Id: If16103078ebe9e4e60470445c0868deb3904f7de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/537239
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This reverts commit 167e608bb3.
Reason for revert: breaking Housekeeper-CheckGeneratedFiles
(fetch-clang-format)
Original change's description:
> [infra] Remove old python scripts and urllib2 references
>
> I was searching for urllib2 while resolving issues with
> https://skia-review.googlesource.com/c/skia/+/538636
> when I found several old, apparently unused scripts.
>
> Rather than fix them, let's get rid of them. If they
> are still in use, the conversion to urllib.request is
> pretty easy.
>
> Change-Id: I27d419601e81c93a3d53e280188a379dfab927c4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538936
> Auto-Submit: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Ravi Mistry <rmistry@google.com>
Change-Id: I139a3cd070da2e6fee2f8865138cf6a63441a8cb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539201
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
I was searching for urllib2 while resolving issues with
https://skia-review.googlesource.com/c/skia/+/538636
when I found several old, apparently unused scripts.
Rather than fix them, let's get rid of them. If they
are still in use, the conversion to urllib.request is
pretty easy.
Change-Id: I27d419601e81c93a3d53e280188a379dfab927c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538936
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Simplify the fields used by each, and simplify the CTORs in
the original SkGlyphRunPainter.
TODO: come up with a better no gpu method. Eventually, this
should be pure Sk. There is no need for GPU to make and
serialize a slug only to draw them.
Change-Id: I446fe0c285ae778a14b30e09c8a2cff3cd1a56c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538896
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
For usages of constants in classes outside of skgpu::tess (e.g. when
using tessellation in skgpu::v1 or skgpu::graphite), the constants are
accessed with tess::. This is just to help with clarity since it scopes
the constant name. However, functions and types are still referred to
without that, and using namespace skgpu::tess is used to keep those
references simpler.
In headers, tess:: is added when there are only a few usages of the
types, or it's brought in as an alias.
Change-Id: I12af595659fe791de419db0393482dae6cd238e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534668
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: I2374fd376f3038e59c82f57c68ac13557058de8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534663
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Moves GlyphVector, TextStrike, StrikeCache, and SubRunAllocator.
Bug: skia:13118
Change-Id: Ifa4957b5cff280f44606dc62bfd30f6a03063c07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536102
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
With HW tessellation removed, fixed-count is the only version of this
approach, so the fixed-count-only constants can be part of
Tessellation.h, leaving FixedCountBufferUtils.h purely for creating the
vertex/index buffers.
Bug: skia:13056, skia:13263
Change-Id: I413a9ebe19fe4427e1ebacee7484d57377abf44e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534563
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit 7d9f07c108.
Reason for revert: fixing public.bzl
Original change's description:
> Revert "Delete HW tessellation shaders for curve/wedge tessellation"
>
> This reverts commit 038818ba8e.
>
> Reason for revert: breaking g3 roll, need to update public bzl file I think
>
> Original change's description:
> > Delete HW tessellation shaders for curve/wedge tessellation
> >
> > GrPathTessellationShader_MiddleOut.cpp is just moved into
> > GrPathTessellationShader.cpp, and a few factories are cleaned up since
> > we don't have to differentiate between middle-out or hardware.
> >
> > Bug: skia:13263
> > Change-Id: I420faa614a89ef1a2c0f1075d1f8a067d15e9a81
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534200
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> Bug: skia:13263
> Change-Id: I42367a21c2bf1a4283e5d9b8d0e00961f9dea2e7
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536039
> Auto-Submit: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bug: skia:13263
Change-Id: I76101f1dbfee454053c8d7502e83d3b04a768b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536096
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Move header to src/text/gpu.
Bug: skia:13118
Change-Id: Ib830643db7ee86262a695edbe6d91a05c3817fcd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535965
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
This reverts commit 038818ba8e.
Reason for revert: breaking g3 roll, need to update public bzl file I think
Original change's description:
> Delete HW tessellation shaders for curve/wedge tessellation
>
> GrPathTessellationShader_MiddleOut.cpp is just moved into
> GrPathTessellationShader.cpp, and a few factories are cleaned up since
> we don't have to differentiate between middle-out or hardware.
>
> Bug: skia:13263
> Change-Id: I420faa614a89ef1a2c0f1075d1f8a067d15e9a81
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534200
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:13263
Change-Id: I42367a21c2bf1a4283e5d9b8d0e00961f9dea2e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/536039
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
GrPathTessellationShader_MiddleOut.cpp is just moved into
GrPathTessellationShader.cpp, and a few factories are cleaned up since
we don't have to differentiate between middle-out or hardware.
Bug: skia:13263
Change-Id: I420faa614a89ef1a2c0f1075d1f8a067d15e9a81
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534200
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: 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>
Noticed that this check could move outside the loop while working on
http://review.skia.org/534560, but didn't want to muddle such a
straightforward CL with additional changes.
Change-Id: I84e0e3348a782f4f5d1b451a48fb14bae87aa33d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534561
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
At http://go/skiareview/c/skia/+/400622/55/bench/SkSLBench.cpp#84,
during the initial DSL parser land, Nanobench was updated to construct
a DSLParser directly instead of calling SkSLCompiler::convertProgram.
This skipped over some important compiler setup--specifically, applying
optimization flags and resetting the inliner.
Unfortunately this means that our optimized benchmark results for the
past ~9 months are not trustworthy at all. The numbers are wildly off:
http://screen/YfZHDvhs9V9Ka6x
"Unoptimized" benchmarks seem to be correct in practice, due to
redundant flag checks. "Optimized" benchmarks, however, are reporting
much better values than they should. The benchmark would stop inlining
after a few iterations of the test, because we'd quickly hit our
internal inlining limit
(https://osscs.corp.google.com/skia/skia/+/main:src/sksl/SkSLInliner.cpp;l=70)
at which point the inliner would turn itself off.
To fix the root cause, Nanobench uses SkSLCompiler::convertProgram
again. Additionally, Compiler::optimize now defensively calls
inliner.reset() before inlining. A second reset shouldn't be necessary,
but it's harmless and free. (This just sets two int fields to zero.)
Change-Id: I690ead14137e4bf74d0f7aa32812bd5b3c21bef5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/534560
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This should make it so the HW tessellation path renderers are never
used; it will always select the atlas or direct fixed-count renderers
instead. This CL will give us a good indication of what visual diffs
to expect, layout tests to rebase, and any performance regressions.
If those are acceptable, then we can proceed with the rest of the code
removal.
Bug: skia:13263
Change-Id: I273bb231461932047768c1c7233ae4291483bc95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533810
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This will allow perf to give us insights on SkVM code generation
performance, so that any regressions are automatically noticed and
trends over time can be observed.
This CL includes three separate benchmarks:
- skvm: Compile SkSL to SkVM with no optimization pass
- skvm_opt: Compile to SkVM and perform optimization/DCE
- skvm_jit: Compile, optimize/DCE, and generate native assembly via JIT
Change-Id: I54ad20d7adb9c5e66d33a2fb761303a269341ff2
Bug: skia:13259
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533957
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
SkVM does not support nonconstant array indexing because this is an ES3
feature, but sksl_large was using the ES3-specific looping binary
colorizer for gradients. This prevented SkVM from compiling the
benchmark. sksl_large has been regenerated with
`nonconstantArrayIndexSupport` set to false in the GrShaderCaps.
Change-Id: If706d9544d1bc0d9c49c59c925a517f677262c85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533956
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Previously, we used the Imgui paint shader. However, it uses a custom
mesh now. This increases its starting size substantially. The bitmap
text shader is a better example of a compact but still functionally-
useful shader.
(I also checked the medium and large shaders; these have not changed at
all since our last update, since Ganesh rarely changes now.)
Change-Id: I8e41aeaf4241d64910bd8188155ba428a6b0dbaa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533879
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Graphite code snippets can be moved into these files; they will be
compiled once at build time and dehydrated for later use. This allows us
to avoid synthesizing and compiling them in each shader where they are
referenced. (Unfortunately, the GPU driver will still need to compile
them each time.)
Change-Id: I5cdc5881d71d7b81a02c91a84d52804f2909b483
Bug: skia:13110
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532259
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
* Move Rectanizer classes to a shared location
* Have GrDrawOpAtlas store SkColorType and explicit bytes-per-pixel
instead of GrColorType.
Bug: skia:13118
Change-Id: Ib5c3d79394c89dce7f06e8eddf09a5f6a9543a7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/531320
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ia799cdff5288efe5d5d53e8d8f77cf32f3343371
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529131
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is a reland of commit ae5e846047
Original change's description:
> [graphite] Move Graphite into Skia base directories.
>
> Change-Id: Ie0fb74f3766a8b33387c145bd1151344c25808cb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528708
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ia575fd49206ad0b665a6a9153317e738bb321446
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529059
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This CL defines a const label string in GrSurfaceProxy and have the
constructors accept it. The label string is then plumbed through the
system for other components to accept it.
Bug: chromium:1164111
Change-Id: I5a7f7708707e3d486eb1f8931db4c49afba5a33b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525236
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>