Commit Graph

50867 Commits

Author SHA1 Message Date
Adlai Holler
ff13ffbeac Reland "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
This reverts commit 89bdc90ac8.

Reason for revert: Fix metal

Original change's description:
> Revert "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
>
> This reverts commit d2daa94ede.
>
> Reason for revert: Metaru
>
> Original change's description:
> > Take GrContext private, GrDDLContext inherit from GrRecordingContext
> >
> > Woo!
> >
> > Change-Id: I8d201b709343dc18cad31ea740575285dd035f35
> > Docs-Preview: https://skia.org/?cl=317436
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Adlai Holler <adlai@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> Change-Id: I9b58dee285fbdc49ebc8e76df5da0fe224cf9787
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318758
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com


Change-Id: Id4b10795193a904cd4ed8c36e60e74abe3b6702a
Docs-Preview: https://skia.org/?cl=318759
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac10.15.5-Clang-arm64-Debug-iOS_Metal,Build-Mac-Clang-x86_64-Debug-Metal
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318759
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-09-23 21:17:47 +00:00
John Stiles
978674a23e Fix crash with invalid out parameters.
Many calls to `setRefKind` failed to check the return value; if it's
false, an error has occurred and the program is in a bad state.
Specifically, there is an assignment to a variable that's not marked as
"written-to." If we continue processing the program, we're likely to
assert.

Change-Id: I2dd5d1f41aa5ca0d30f8d638f05fe2e838216d78
Bug: skia:10753
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319116
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-09-23 20:36:17 +00:00
Chris Dalton
e2067645ef Optimize GrWangsFormula
Adds various optimizations to GrWangsFormula as well as "pow4" variants
of the formula that are quicker than the standard and/or log2 versions.
Uses the pow4 variants in GrStrokePatchBuilder.

Bug: skia:10419
Change-Id: I8478582df5296b088d25808bcaeb93107ff20797
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318954
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-09-23 20:35:47 +00:00
John Stiles
59b2a92c96 Add new unit tests for SkSL.
These cover:
- Properly configured out-params
- Invalid/non-lvalue out-params, which currently cause an SkSL crash
- Interactions between the inliner and variable swizzles

Change-Id: I4874101236084f273e704d8717149b431d813883
Bug: skia:10753
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319036
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-23 20:30:47 +00:00
Brian Salomon
2bded27a96 Allow rect and circle blur fast cases to be used with rotation matrices.
For circles this is trivial. The existing shader works as is.

For rects this requires back projecting from device space.

Adds a GM for rotated rect blurs and modifies a circle blur GM to add
rotation.

Bug: chromium:1087705

Change-Id: I6b969552fbcc9f9997cfa061b3a312a5a71e8841
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318757
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-09-23 20:01:07 +00:00
Brian Osman
e498b3c75b Various cleanup related to symbol tables
- Remove a spurious symbol table inserted by convertProgram. start()
  already pushes a symbol table, and this was pushing a second one,
  which didn't seem necessary. (The Parser can inject symbols for types
  it discovers, but I can't justify those needing to be in a different
  table than the rest of the program elements?)
- The convertProgram one had a comment indicating that it was popped by
  the Compiler. That wasn't true, so this gets us one step closer to
  balance.
- The one in start() is meant to be balanced by a pop in finish(), but
  no one ever called finish(). Add that call in, and also rearrange
  things so that the base symbol table is a parameter to start(), rather
  than just setting it on the IR generator. (There's more of this
  pattern around, but I wanted to limit the scope of this CL).
- When dehydrating the include files, we had logic to work around the
  extra symbol table (absorbing the symbols) - that's not needed now.
- Simplify some other logic in processIncludeFile (no need to make so
  many string copies). Always just put the incoming include file strings
  into the root table, also. It's largely irrelevant where they go.

Change-Id: I18d897af3d5fa6506e11024beb9bb70e6cc5b538
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319038
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-23 19:55:08 +00:00
Greg Daniel
1d3c8c1a8b Add optional param to setBackendTextureState to return previous state.
Bug: skia:10742
Change-Id: I334e7896d0a1509eb666c46d5731d2573a5c1aba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318698
Reviewed-by: Austin Eng <enga@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-09-23 19:54:59 +00:00
Adlai Holler
7b97b3cb2b Reland "Migrate metal tools away from GrContext"
This reverts commit 18f4b1c7e3.

Reason for revert: Fixed iOS

Original change's description:
> Revert "Migrate metal tools away from GrContext"
>
> This reverts commit 3eb813e0cc.
>
> Reason for revert: Broke iOS
>
> Original change's description:
> > Migrate metal tools away from GrContext
> >
> > Change-Id: I73a73ca5d088c35acd23be3336d8d1e3e859a82e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318760
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Auto-Submit: Adlai Holler <adlai@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> Change-Id: Idf74c936cfe8481e18455dcc0faa21155884b198
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319017
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com


Change-Id: I6e14a333be4a960af0434bbcb6ce9a1a2271dca6
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-arm64-Debug-iOS_Metal,Test-iOS-Clang-iPhone11-GPU-AppleA13-arm64-Debug-All-Metal,Test-Mac10.13-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Debug-All-Metal,Test-Mac10.13-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Debug-All-DDL3_Metal
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319018
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-09-23 19:11:07 +00:00
Chris Dalton
49814b9fdc Merge joins into the same tessellation patch as their following stroke
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>
2020-09-23 19:05:17 +00:00
Chris Dalton
d1e6716f6a Add an "allPathsVolatile" option for testing
Bug: skia:10419
Change-Id: I4bb2dc515448d8c87329ade90d24bf78ca1d7938
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319097
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-09-23 19:02:27 +00:00
John Stiles
db62d088ef Bring back the harness from SkSLGLSLTest as a testbed for debugging.
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>
2020-09-23 18:44:47 +00:00
Chris Dalton
6756afabb6 Fail the "tess_segs_5" tests if Skia doesn't actually give us 5 tessellation segments
Bug: skia:10419
Change-Id: I5363ac6ac74131341d010cf2958cc5d7a070689f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318782
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-09-23 17:03:57 +00:00
Brian Osman
81fc1fc3bf Remove fRootSymbolTable from IR Generator
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>
2020-09-23 17:02:37 +00:00
John Stiles
647a9bd7c2 Convert the remaining FP tests to golden outputs.
(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>
2020-09-23 16:21:58 +00:00
Nathaniel Nifong
ba615e892f Fixes for canvaskit karma tests in google3
Change-Id: I4945f99016ed7424ed0fe8cca1f0006396a1ad44
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317857
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-09-23 14:51:27 +00:00
John Stiles
443d2c17b7 Revert "Calculate texture clamping X/Y coordinates in parallel."
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>
2020-09-23 13:55:49 +00:00
Robert Phillips
c2fe1644db Add time-based purging to the GrThreadSafeUniquelyKeyedProxyViewCache
Bug: 1108408
Change-Id: I7dd4a3b1b20f3267903dd7f303a2d639b562d84a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318761
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-23 13:07:50 +00:00
Michael Ludwig
462bdfc06e Allow non-AA clip rects to be scissor only even on MSAA targets
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>
2020-09-23 13:05:00 +00:00
Adlai Holler
18f4b1c7e3 Revert "Migrate metal tools away from GrContext"
This reverts commit 3eb813e0cc.

Reason for revert: Broke iOS

Original change's description:
> Migrate metal tools away from GrContext
> 
> Change-Id: I73a73ca5d088c35acd23be3336d8d1e3e859a82e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318760
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Auto-Submit: Adlai Holler <adlai@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com

Change-Id: Idf74c936cfe8481e18455dcc0faa21155884b198
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319017
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-09-23 12:59:32 +00:00
skia-autoroll
f6a871d8e3 Roll ANGLE from f39e0f01aa1f to 2a09e89113af (18 revisions)
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>
2020-09-23 05:07:20 +00:00
skia-autoroll
2d3f449062 Roll Chromium from 1d6daec3949b to 9a7bc8d5069f (510 revisions)
1d6daec394..9a7bc8d506

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-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:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: csmartdalton@google.com
Change-Id: I35f00b3bd9d7c3db88ebcab51470bd006eb135b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318956
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-23 04:40:40 +00:00
skia-autoroll
65abf4b832 Roll dawn from 52a588f3c9ba to 0b29732cd84f (5 revisions)
https://dawn.googlesource.com/dawn.git/+log/52a588f3c9ba..0b29732cd84f

2020-09-22 enga@chromium.org Pass the old/new VkImageLayouts to Vulkan image import/export
2020-09-22 brandon1.jones@intel.com Change wgpu::Color from floats to doubles
2020-09-22 bryan.bernhart@intel.com Revert "Disable debug layer logger"
2020-09-22 cwallez@chromium.org Simplify the BindGroupLayout validation code.
2020-09-22 cwallez@chromium.org Reuse BGL validation in default layout computations.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dawn-skia-autoroll
Please CC cwallez@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-Debug-Dawn
Bug: None
Tbr: cwallez@google.com
Change-Id: If43ee2f492ca8b504d35ef63ded6ecf0f031e783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318938
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-23 04:34:50 +00:00
Adlai Holler
3eb813e0cc Migrate metal tools away from GrContext
Change-Id: I73a73ca5d088c35acd23be3336d8d1e3e859a82e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318760
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-09-22 22:33:09 +00:00
Chris Dalton
7c76b09445 Extract SkFindCubicMidTangent from SkChopCubicAtMidTangent
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>
2020-09-22 22:28:10 +00:00
Brian Osman
2b469ebd06 SkSL: Start refactoring pre-include handling
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>
2020-09-22 21:39:39 +00:00
John Stiles
d4867c94be Add rc accessor method to SkMatrix.
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>
2020-09-22 21:32:20 +00:00
John Stiles
544a32ff23 Promote bool(k) to true/false during constant propagation.
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>
2020-09-22 21:18:49 +00:00
Adlai Holler
89bdc90ac8 Revert "Take GrContext private, GrDDLContext inherit from GrRecordingContext"
This reverts commit d2daa94ede.

Reason for revert: Metaru

Original change's description:
> Take GrContext private, GrDDLContext inherit from GrRecordingContext
> 
> Woo!
> 
> Change-Id: I8d201b709343dc18cad31ea740575285dd035f35
> Docs-Preview: https://skia.org/?cl=317436
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com

Change-Id: I9b58dee285fbdc49ebc8e76df5da0fe224cf9787
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318758
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-09-22 20:50:01 +00:00
John Stiles
4b4e32f038 Fix ClangTidy bugprone-bool-pointer-implicit-conversion warning.
`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>
2020-09-22 20:22:12 +00:00
John Stiles
9878d9e62f Fix nondeterminism when copying intrinsic functions.
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>
2020-09-22 20:20:19 +00:00
Adlai Holler
d2daa94ede Take GrContext private, GrDDLContext inherit from GrRecordingContext
Woo!

Change-Id: I8d201b709343dc18cad31ea740575285dd035f35
Docs-Preview: https://skia.org/?cl=317436
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317436
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-09-22 20:03:19 +00:00
Robert Phillips
331699c9ea Yet more GrThreadSafeUniquelyKeyedProxyViewCache purging tests
This CL also renames dropAllUniqueRefs

Bug: 1108408
Change-Id: Ic39ccfc5efafd60d53524562dd308102fb134d94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318737
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-22 20:02:40 +00:00
John Stiles
a5f3c31490 Create VariableExpression struct for referencing inlined variables.
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>
2020-09-22 19:32:29 +00:00
Robert Phillips
c61c895393 Fix a GrThreadSafeUniquelyKeyedProxyViewCache test
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>
2020-09-22 19:08:49 +00:00
John Stiles
d0e4840b11 Fix crash when swizzling a bvec with constant 0/1s.
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>
2020-09-22 19:08:42 +00:00
John Stiles
5f35ac9faa Add unit test for swizzling booleans.
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>
2020-09-22 18:47:19 +00:00
Jim Van Verth
772e04d1af Make sure we release all refs in GrD3DTextureResource::releaseResource.
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>
2020-09-22 18:41:50 +00:00
Nathaniel Nifong
3d6d4160ee Reland "include freetype in wasm build, see cl/332073924 for complete change"
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>
2020-09-22 18:01:09 +00:00
Robert Phillips
187b04b357 Increase testing of GrThreadSafeUniquelyKeyedProxyViewCache wrt GrResourceCache purging
Bug: 1108408
Change-Id: I2d6f89ce71b8d94be22b1ff38b9e205df94ca765
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318205
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-09-22 16:54:39 +00:00
Michael Ludwig
84a008fa55 GrClipStack::contains, add fast path for axis-aligned paths
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>
2020-09-22 16:26:39 +00:00
John Stiles
a9be76de8b Reduce the number of inliner temporaries by swizzling.
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>
2020-09-22 15:43:19 +00:00
John Stiles
a38945abe3 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>
2020-09-22 14:58:39 +00:00
Florin Malita
8b5ed02eb0 Fix skia_use_ffmpeg builds
... post https://skia-review.googlesource.com/c/skia/+/317109

Change-Id: I7286fd6d7598a50a1db452f04a28317c600f4984
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318477
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-09-22 14:25:10 +00:00
Brian Osman
d8efe7029b Change default of fBuiltinFMASupport back to false
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>
2020-09-22 14:23:49 +00:00
Michael Ludwig
b28e141787 Use analytic coverage FPs with MSAA
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>
2020-09-22 13:54:19 +00:00
Brian Osman
5d8b7e9e49 Remove RTAdjust plumbing
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>
2020-09-22 13:50:09 +00:00
Greg Daniel
77960d9add Revert "include freetype in wasm build, see cl/332073924 for complete change"
This reverts commit 6cc032c12d.

Reason for revert: breaking some g3 projects

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>

TBR=mtklein@google.com,nifong@google.com

Change-Id: Ib7556494f801441f6770b8175fc818c9a8cdf21d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318496
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-09-22 13:43:51 +00:00
skia-autoroll
7a1f241c01 Roll Chromium from 688a0b341c70 to 1d6daec3949b (400 revisions)
688a0b341c..1d6daec394

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-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:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: csmartdalton@google.com
Change-Id: Idd7214336ffe83ec82da7976e1063f6f2d4a6ba9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318310
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-22 04:53:38 +00:00
skia-autoroll
4395b2a449 Roll ANGLE from 48588bd1810d to f39e0f01aa1f (25 revisions)
48588bd181..f39e0f01aa

2020-09-22 syoussefi@chromium.org Vulkan: Use subpass to unresolve render-to-texture attachments
2020-09-21 jmadill@chromium.org Add restricted trace golden image script test.
2020-09-21 jmadill@chromium.org Trace/Replay: Reset replay after taking a screenshot.
2020-09-21 ianelliott@google.com Vulkan: Further refine invalidate for depth/stencil
2020-09-21 syoussefi@chromium.org Vulkan: Disallow loadOp=LOAD for MSRTT depth/stencil textures
2020-09-21 lehoangq@gmail.com Metal: Implement PBO.
2020-09-21 ianelliott@google.com Vulkan: Fix copy-paste error in hasCopyImageView
2020-09-21 lexa.knyazev@gmail.com Metal: Implement ASTC LDR support
2020-09-21 jmadill@chromium.org Vulkan: Optimize Attribute Change Perf (5/5)
2020-09-21 jmadill@chromium.org Fix early fragment tests optimization condition.
2020-09-21 lexa.knyazev@gmail.com Metal: Implement BPTC support
2020-09-21 ynovikov@chromium.org Skip Texture2DTest.TexStorageWithPBO on Win NVIDIA GL
2020-09-21 jmadill@chromium.org Test Runner: Fix default config grouping.
2020-09-21 jmadill@chromium.org Test Runner: Add more timeout logging.
2020-09-21 lehoangq@gmail.com Metal: Fix wrong FormatID enum order used by PBO autogen shaders.
2020-09-21 jmadill@chromium.org Test Runner: Allow empty sharding parameters.
2020-09-21 jmadill@chromium.org Remove zlib from export_target exceptions.
2020-09-21 jmadill@chromium.org Give trigger.py executable bit.
2020-09-21 jmadill@chromium.org Suppress Linux GL Compute Tests on Intel.
2020-09-21 jmadill@chromium.org Disable slow max uniform count test on D3D11/Intel.
2020-09-21 jmadill@chromium.org Rename ShaderImpl::mData to mState.
2020-09-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from d6935becabad to 0a863bc36554 (1 revision)
2020-09-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Headers from f0e102e48197 to 7f9879b1b1fa (1 revision)
2020-09-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll glslang from 9eaa69c21c45 to 4dcc12d1a441 (1 revision)
2020-09-21 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 50ae4c5f4427 to 60ce96e2ff10 (2 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 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: chromium:1032721
Tbr: csmartdalton@google.com
Test: Test: DrawCallPerfBenchmark.Run/vulkan_attrib_changeTest: Test: tested with trigger.py
Change-Id: Ie8179a2ae1f3ccbbbe597e35fe7dc8646eb14cf2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318309
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-22 04:42:43 +00:00
skia-autoroll
6f1356d608 Roll SwiftShader from fe878dedd5ad to 6aadd31a5f98 (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/fe878dedd5ad..6aadd31a5f98

2020-09-21 srisser@google.com Implement VK_KHR_image_format_list

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-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:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: csmartdalton@google.com
Change-Id: Ibb4a7e827fdf8e43a3b89176d1cd918c0535928c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318308
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-22 04:40:38 +00:00