Implements the previous join as a sub-section of the tessellation
patch. This cuts the number of vertex shader invocations in half since
we are no longer treating joins as their own patch. (This therefore
cuts the amount of inflection/midtangent chopping work in half also.)
This required a lot of modifications to GrStrokePatchBuilder.cpp, so
this CL also finishes up the chopping logic in that file for when there
aren't enough tessellation segments to render a curve.
Bug: skia:10419
Change-Id: I3da081fe756c97aeeb65e27f1319a29763b4ad34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318876
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
The code here is resuscitated from the GLSL testing harness at
http://review.skia.org/317771 . Testing and debugging in dm is simpler
than debugging skslc when we encounter compiler issues.
Change-Id: I492dd0bbd2f0ee0b3b6a1b5253da54d72dc1eb3b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319032
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>
Two Compiler methods that use the root symbol table are still dangerous,
they're polluting the global namespace. For long-lived compilers, we
don't want to do that. takeOwnership is only used in tests, but
registerExternalValue is used by particles. Thinking I'll move that to
an optional argument to convertProgram, or a field on Settings.
Change-Id: Ic88d29d053510001931dcc2388aba2dc83a953ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319030
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
(Removed one test, SkSLFPSwitchWithMultipleReturnsInside, because it was
redundant with existing tests.)
Change-Id: I1bfc069babdb5eb0cc515f195c3a2e307bb5871a
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319029
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>
This reverts commit a38945abe3.
Reason for revert: Pinpoint says it costs RAM on Mac (?), and doesn't show any visible perf benefit
Original change's description:
> Calculate texture clamping X/Y coordinates in parallel.
>
> The X and Y values of `clampedCoord`, `extraRepeatCoord`, and `snapped`
> were being calculated and stored separately, even in cases where work
> could easily be done in tandem. Updated the code so that we use .xy when
> it makes sense to do so.
>
> Change-Id: I10d85670acb4fec960444b3f3c30f2929c6dcaf2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318436
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
TBR=bsalomon@google.com,johnstiles@google.com
Change-Id: I10aaba4caeacaa0b081d10cc900044c37f690782
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319021
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This appears to fix the performance regressions seen on a number of webpage
SKPs for vkmsaa8 and glmsaa targets on devices that can't disable multisampling.
Bug: skia:10730
Change-Id: I2c10a78cfe864f987b7f17eb69eb2e1712ca0676
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317772
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
f39e0f01aa..2a09e89113
2020-09-23 jmadill@chromium.org Isolated script args in restricted trace tests.
2020-09-23 jmadill@chromium.org Suppress two more compute shader tests.
2020-09-23 jmadill@chromium.org Skip another slow test on Win/Intel/D3D11.
2020-09-22 courtneygo@google.com Vulkan: Fix racy access to VkPipelineCache
2020-09-22 cclao@google.com Vulkan: Add a alpha to coverage test
2020-09-22 lehoangq@gmail.com Metal: Support array of matrices varying.
2020-09-22 geofflang@google.com Vulkan: Add features to modify sampling parameters
2020-09-22 timvp@google.com Vulkan: Allocate descriptor pools with layouts
2020-09-22 jmadill@chromium.org Use c++ thread_local for current thread.
2020-09-22 geofflang@google.com Initialize InternalFormat::blendSupport.
2020-09-22 jmadill@chromium.org Pass #pragma optimize setting down to compilation.
2020-09-22 jmadill@chromium.org Give restricted gold tests executable bit.
2020-09-22 jmadill@chromium.org Test Runner: Improve sharding validation.
2020-09-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from fe878dedd5ad to 6aadd31a5f98 (1 revision)
2020-09-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Loader from a148cdd49041 to 8fdc21e4078d (1 revision)
2020-09-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 60ce96e2ff10 to 125b64241909 (1 revision)
2020-09-22 jmadill@chromium.org Suppress 3 more Intel/GL/Compute shader fails.
2020-09-22 lehoangq@gmail.com Metal: Disable unused attribute slots.
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 csmartdalton@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
Bug: None
Tbr: csmartdalton@google.com
Test: Test: CQTest: Test: DrawCallPerfBenchmark.Run/vulkan_nullTest: Test: EGLContextASANTest.DestroyContextInUse/ES3_Vulkan
Change-Id: I6c6c95919bb1f17aceb0e75954d258942d8128ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318937
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Also does the same for the quadratic variants.
Bug: skia:10419
Change-Id: I4a0e46a0d76d16dcf452f39c7e2552975ec46ed6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318783
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This makes IRIntrinsicMap an actual type, and supports chaining (so an
intrinsic map can have a parent, just like a symbol table). That lets us
put Enums and defined functions at multiple levels of the pre-include
hierarchy.
With that done, we add an intrinsic map for sksl_fp.sksl, containing the
enum declarations from that file. This lets .fp processing using the FP
intrinsic map (which is parented to the GPU one) to resolve those enums
(PMConversion, GrClipEdgeType), as well as the enums in sksl_gpu
(SkBlendMode).
Because sksl_fp was being used to generate an inherited element list
(containing several builtin variables), I have relaxed the restriction
around grab_intrinsics - unsupported element types are simply left in
the original vector, unchanged. for the GPU and interpreter intrinsic
maps (where the element lists are discarded), we still assert that we
didn't end up with any unsupported elements.
Doing all of this lets us remove the redundant enum resolution code in
IR generator (where we previously supported looking up enums in both the
inherited element list, and in the intrinsic map).
Subsequent changes will add support for variables/declarations to the
intrinsic map, so we won't need both the inherited list and the
intrinsic map, if all goes well.
Change-Id: Ic6174511e5f8d68f65e4919f2ec0b923717d6cd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318212
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
FP gencode reads back matrix values in its dumpInfo method using rc().
This worked for SkM44; now it will work for SkMatrix as well.
Change-Id: I4efc7018529bd3c84aacc073fad2bfca7e12c517
Bug: skia:10748
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318756
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Cleaned up some nearby code while implementing this fix as well.
Change-Id: Ic084451f0d9fc12169e1720a8889a290249eb5e9
Bug: skia:10750
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318796
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>
`isFixedPitch` is a bool*. The surrounding lines were updated to
maintain consistency.
Change-Id: Ic604d159ff77a1f4b7e2942c0bdbd4d68f0318b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307496
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Previously, we copied intrinsic functions in a totally arbitrary order;
it used an unordered_set of pointers, so it could be affected by
switching standard libraries OR by malloc nondeterminism. (Surprisingly,
it was fairly consistent in practice on OS X/Linux.) This CL sorts the
intrinsic functions into a consistent order before copying them.
Change-Id: If90342bb77a9ae237a3ce91be3a9847311a722c4
Bug: skia:10749
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318700
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
In this CL, the result expression has been updated to use
VariableExpression; followup CLs will update the VariableRewriteMap to
leverage it as well.
This is intended to allow the inliner to inline simple expressions (such
as literals or swizzles) directly if they are not written to, instead of
making an extraneous copy.
Change-Id: I050057d8c3e940e5e44c22fde2f4bc37bb4c6754
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318576
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
I broke this when I switched over to the SkTDynamicHash
Bug: 1108408
Change-Id: I906b41330440d084ba2e97c0162af38a79da0529
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318696
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Code like
bool4 result = val.xy01;
Will now be converted to:
bvec4 result = bvec4(val.xy, bool(0), bool(1));
Previously it tried to do this, but there isn't an implicit conversion
from int to bool, so it was silently failing and adding nulls into the
constructor:
bvec4 result = bvec4(val.xy, $coerceToBool(0), $coerceToBool(1));
This CL also cleans up some related code that I was checking while
trying to understand the nature of the error.
Change-Id: I5b7d96760a03170ff78b46251c4182cc4e89836f
Bug: oss-fuzz:25781
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318636
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This test currently crashes skslc, but will be fixed in the followup CL.
Change-Id: I3683d94a310242e8ca67560296518fd1223b28d0
Bug: oss-fuzz:25781
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318656
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We were holding on to an additional ref to the ID3D12Resource* in the
fInfo struct, so it didn't actually get released until the destructor.
Change-Id: I529daf66ff6caf1516fd21881f9820d7d21bb642
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318657
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This is a reland of 6cc032c12d
Original change's description:
> include freetype in wasm build, see cl/332073924 for complete change
>
> Change-Id: I2f1d6ef2719191fe9a56e31712c058c3207d23a9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317615
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Nathaniel Nifong <nifong@google.com>
Change-Id: I7026b40885eb202fa8df1d2ba71e698818b84132
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318577
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
This seems to address the performance regressions seen in the new
GrClipStack for the Missouri seal svg. An alternative was to just
always transform paths to device space, but this hurt other benchmarks.
This CL leaves us with a more efficient contains and but still keeps
the lazy transformation to device space.
Bug: skia:10730
Change-Id: I4494cd24efbce767b2cc981d8942aafe8328dfb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317858
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Ideally the inliner would be smart enough to avoid creating a temporary
at all just for a swizzle, but a good first step is to create fewer of
them.
Change-Id: Icd6f86c294237488f7923dc787bb64a5f99bd0ac
Bug: skia:10737
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318213
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
The X and Y values of `clampedCoord`, `extraRepeatCoord`, and `snapped`
were being calculated and stored separately, even in cases where work
could easily be done in tandem. Updated the code so that we use .xy when
it makes sense to do so.
Change-Id: I10d85670acb4fec960444b3f3c30f2929c6dcaf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318436
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Being conservative here is better - it's a feature that's only exposed
on newer GL and ES. This fixes WebGL.
Follow-up from https://skia-review.googlesource.com/c/skia/+/317204
Bug: skia:10745
Change-Id: I319fc6b9379a14c09b9ccce6da8bed2effe09821
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318497
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This addresses the performance regressions on vkmsaa8 and other msaa
locked devices from the new GrClipStack. Now that elements are forced
to upgrade to AA, this allows axis-aligned anti-aliased rects to be
implemented as an FP instead of generating a stencil mask.
This is an alternative to https://skia-review.googlesource.com/c/skia/+/317772
and does not appear to regress visual quality.
Bug: skia:10370
Change-Id: If89b4368fb0c684851e6648bf70e1b608e19852c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317836
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Change-Id: I935784aae438ac767cca03eb25853f4230297bb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318214
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Early returns can cause the inliner to generate suboptimal code. We
control our built-ins, so let's avoid them where we can.
Patterns like this challenge the inliner:
if (x) return y;
return z;
But this can be replaced by equivalent code that inlines better:
return x ? y : z;
Or, if a ternary can't be used, this also does a better job:
if (x) return y;
else return z;
In several cases, this allows the inliner to avoid generating a
do-while(false) block for control flow.
Change-Id: I921c929122297c40476ff15b4da631fc1581e308
Bug: skia:10737
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318211
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
I realized that "DefaultSettings" as a name suffix was unclear, because
"Default" is a different settings mode from skslc running with
--nosettings.
In --nosettings mode, skslc uses "standalone" settings.
Change-Id: I1f5d80df0a21cec55948c4ad146169bcb34f4999
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318210
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit b8ae7fa12a.
Reason for revert: Introduced a memory leak
Original change's description:
> Reland "Use Microsoft's ComPtr to wrap D3D12 objects."
>
> This is a reland of 0ef049177f
>
> Original change's description:
> > Use Microsoft's ComPtr to wrap D3D12 objects.
> >
> > Change-Id: I4bd173428a2b65f0bc1994fb794ef9d4d68d5ba0
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314957
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Jim Van Verth <jvanverth@google.com>
>
> Change-Id: Id0199db4061c67ed53da35e74dc31a004744be95
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315655
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I3f8744668558f6b8f4f367eeeeff2f6aa2c36992
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318209
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Several blend functions generate a surprisingly large amount of code,
and appear to have opportunities for further optimization. At any rate,
if we make compiler changes that would affect the output of a blend
function, I think we would want to see the changes reflected in our
golden outputs.
Change-Id: Iff612dcd4bad8824b5e6e97413ffce19e5ea1c0e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318336
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>
This doesn't change the meaning or intent at all, just makes the code
easier to read.
Change-Id: I998498de8fba625d86eadc2fba119c29a1e1d29a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318202
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Passing in VK_IMAGE_LAYOUT_UNDEFINED will tell Skia to not update the
layout when doing the state change.
Bug: skia:10742
Change-Id: Ic59b7c95d3a73e29dcd6eec16a2fd138e1a1d95f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318204
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is the start of trying to have all our different types of "surface"
allocations share a common class. we will soon follow up with also having
an msaa attachment class derivie from GrSurface.
Bug: skia:10727
Change-Id: I50e78d232a454b1dd35cf9606791390ce5a6396b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317392
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>