Commit Graph

50921 Commits

Author SHA1 Message Date
John Stiles
6798e5d0d1 Migrate SkSL error tests to golden outputs.
Change-Id: Ic8f4730d035981c32b4ddb48e5e919b0396b6d93
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317578
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-09-18 13:46:17 +00:00
Jim Van Verth
fbbf9e27fb D3D: Reset current descriptor tables when changing root sig.
If we switch from a root signature with samplers/textures to one without
and then back, the descriptor tables associated with them are unbound on
the command list, but we don't reflect that in our tracking of the
current descriptor table.

Change-Id: Ibd3891152f1beab10c20caa1f2aaec0cd59e519e
Bug: skia:9935
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317656
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
2020-09-18 13:44:37 +00:00
Mike Klein
feb4d10f7b tweak gathers in skvm interpreter
- simplify 1-stride gathers by using broadcasts
  - use map() for base-case full-stride gathers

  - TODO: use vpgatherdd for full-stride gathers when possible

Change-Id: Icedcea17ae8fa4ad7344cd2604358fd710921af2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317648
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-18 12:37:47 +00:00
skia-autoroll
ec598d5b00 Roll ANGLE from 0a8a3ea25b36 to 8d4331eeb5ea (13 revisions)
0a8a3ea25b..8d4331eeb5

2020-09-18 syoussefi@chromium.org Vulkan: Free up 5 bits in RenderPassDesc
2020-09-17 jmadill@chromium.org Guard against race in perf warnings.
2020-09-17 jmadill@chromium.org Vulkan: Fix racy access to VkPipelineCache.
2020-09-17 jmadill@chromium.org Fix racy global in gl::Compiler.
2020-09-17 ianelliott@google.com Vulkan: Delay vkAcquireNextImageKHR till later
2020-09-17 syoussefi@chromium.org Vulkan: Support MSRTT color renderbuffers
2020-09-17 jmadill@chromium.org GN: Componentize D3D back-ends.
2020-09-17 m.maiya@samsung.com EGL: Add support for EGL_ANDROID_create_native_client_buffer
2020-09-17 amy.liu@arm.com Fix the regression of color blit.
2020-09-17 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from e8ce4355ae1c to 34ef0c3fdc8e (5 revisions)
2020-09-17 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from f105898a102f to 46fc663a1cb3 (4 revisions)
2020-09-17 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from b33e0b36a08c to fe878dedd5ad (1 revision)
2020-09-17 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from e4cbd27e4a55 to d9fa0d469f57 (420 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: None
Tbr: scroggo@google.com
Test: Test: angle_deqp_egl_tests --gtest_filter=dEQP.EGL/functional_query_context_get_current_display_rgba8888_window* --use-angle=vulkanTest: Test: angle_end2end_tests --gtest_filter=*EGLPreRotationSurfaceTest*/*Test: Test: angle_perftests --gtest_filter=GenerateMipmapBenchmark.Run/vulkan_webglTest: Test: angle_white_box_tests --gtest_filter=VulkanPerformanceCounterTest.*Invalidate*/*Test: Test: dEQP-GLES3.functional.fbo.blit.default_framebuffer.*_linear_*
Change-Id: Ib62c6aa99ad538964bbba7e40abdd658ad9ba37e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317702
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-18 04:52:47 +00:00
skia-autoroll
2e89397021 Roll Chromium from 70a60d856acd to 33c87dade16e (467 revisions)
70a60d856a..33c87dade1

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 scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary: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: scroggo@google.com
Change-Id: I7e922ad7694bb3b368481ea904e92f3769aade17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317700
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-18 04:41:47 +00:00
skia-autoroll
795fa782ca Roll dawn from 6419bddd9b0c to d6498a41ab4e (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/6419bddd9b0c..d6498a41ab4e

2020-09-18 hao.x.li@intel.com Query API: Timestamp Query on Vulkan
2020-09-17 bryan.bernhart@intel.com D3D12: Align UBO sizes to 256B.
2020-09-17 rharrison@chromium.org Enable running robust buffer access pass on shaders
2020-09-17 enga@chromium.org Typeify VertexBufferSlot and VertexAttributeLocation

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: Ie117d6d8e4bf9369b294b4023b2a1b16f36e130e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317701
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-18 04:32:07 +00:00
Chris Dalton
31634288fd Add gms that test limited hw tessellation segments
Adds variations of trickycubicstrokes and widebuttcaps that limit the
max number of hardware tessellation segments to 5. This exercises our
stroking logic for splitting curves and joins when they require more
segments than are supported by the hardware.

Bug: skia:10419
Change-Id: Ie52374b89e30bfa021b2de74e3cd32e02ab734d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317268
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-17 23:48:44 +00:00
Herb Derby
ad48610a01 use digests internally for SkScalerCache
Switch to using digests internally for the bulk
glyph processing calls. Put attributes in the digest
that the bulk loops need for processing.

Change-Id: I5852a5f8fa86759ec4b4a7b9937400f19abcf034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317588
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-09-17 22:09:04 +00:00
Mike Reed
b4aa639f23 Refactor API for mipmap-builder,
now the builder returns the new image.

Change-Id: Ie56256390b96d3fdbe39f89784276947047df656
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316442
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-09-17 21:46:44 +00:00
Mike Klein
7e129b8b89 Reland "refactor any()/all(), ptest for all()"
This is a reland of e24f7f3de7
... with fix for ~0 constants for the pedantic MSVC.

Original change's description:
> refactor any()/all(), ptest for all()
>
> Part of this is a simple refactor, adapting any() and all() to the new
> style of specialization.
>
> And with that refactor in place, add AVX2/SSE4.1 for all() using ptest.
> This isn't terribly important, but it does help make Op::asserts run
> faster in the SkVM interpreter.  I like to run with asserts enabled, and
> this makes passing asserts much cheaper---failing asserts are expensive
> still of course, printing to SkDebugf(), etc.
>
> Change-Id: Iebdeee701fab7c50cce8e457674b565f7dd2ec21
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317422
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Cq-Include-Trybots: luci.skia.skia.primary:Build-Win-MSVC-x86_64-Debug
Change-Id: I93f08177ef3439e65e4383cc517dba60c0c4ef3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317638
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-09-17 21:19:04 +00:00
John Stiles
27f189fa4f Allow constant propagation of unary negation.
The copy_constant function did not expect to see a prefix expression.

Change-Id: Id2beb64b8d65f6b35cd68306452104ba28f56f2b
Bug: skia:10734
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317616
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-17 21:10:34 +00:00
Kevin Lubick
c21dc07a78 [canvaskit] Add demo on how to decode images in web worker
Change-Id: I3c9107799c5df2c39a8ea8ddf106978786de79f7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317389
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-09-17 20:15:05 +00:00
Mike Klein
952f8f17e4 Reland "update skvx scalar-fallback strategy"
This is a reland of 4985db413d

...with a better implementation of map().  I don't understand
why we had to revert, but it had something with calling the
function pointer in map_(), so maybe this will help.

I've flattened the map_() / map() merge CL into this one,
and marked the resulting map() as no_sanitize("cfi").  I
don't see anything wrong, so I think it's a false positive.

Original change's description:
> update skvx scalar-fallback strategy
>
> Turns out Clang's a lot better at auto-vectorizing "obvious" scalar code
> into obvious vector code when it's written out the long way, e.g.
>
>      F32x4 x = ...;
>      x = { sqrtf(x[0]), sqrtf(x[1]), sqrtf(x[2]), sqrtf(x[3]) };
>
> vectorizes into sqrtps a lot more reliably than our recurse-onto-scalars
> strategy, and also better than the other naive approach,
>
>      F32x4 x = ...;
>      for (int i = 0; i < 4; i++) { x[i] = sqrtf(x[i]); }
>
> So here I've added a map(V, fn) -> V' using C++14 tricks to let the
> compiler handle the expansion of x = { fn(x[0]), fn(x[1]), ...
> fn(x[N-1]) } for any N, and implemented most skvx scalar fallback code
> using that.
>
> With these now vectorizing well at any N, we can remove any
> specializations we'd written for particular N, really tidying up.
>
> Over in the SkVM interpreter, this is a big improvement for ceil and
> floor, which were being done 2 floats at a time instead of 8.  They're
> now slimmed way down to
>
>    shlq       $6, %r13
>    vroundps   $K, (%r12,%r13), %ymm0
>    vroundps   $K, 32(%r12,%r13), %ymm1
>    jmp        ...
>
> where K is 9 or 10 depending on the op.
>
> I haven't found a scalar function that Clang will vectorize to vcvtps2pd
> (the rounding one, not truncating vcvttps2pd), so I've kept lrint()
> written the long way, updated to the style I've been using lately with
> specializations inline.
>
> Change-Id: Ia97abe3c876008228bf62b1daacd6f6140408fc4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317375
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Cq-Include-Trybots: luci.chromium.try:linux_chromium_cfi_rel_ng
Bug: chromium:1129408
Change-Id: Ia9c14074b9a14a67dd221f4925894d35a551f9d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317551
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-09-17 19:58:34 +00:00
Brian Osman
3ed22a9c0c Disallow narrowing conversions as part of matrix multiply-assignment
By doing the component-type deduction with simple multiplication:

  halfVec *= floatMat

Would decide that the resulting component type could be float, which
actually caused an assert later (because coerce() had to wrap the
variable reference in a Constructor, making it an invalid target for a
write).

Change-Id: I459897c62d80ecb1e406e5b351a80c25427d5a30
Bug: skia:10732
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317587
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-17 19:57:24 +00:00
Greg Daniel
95cf99b4ea Don't always set vulkan blend constant when not using it.
Change-Id: I478cf455384c95328d730625d903c30d226fd319
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317577
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-09-17 19:41:54 +00:00
Herb Derby
45f41b3762 rename SkGlyphIndex to SkGlyphDigest
Change-Id: I78f28da3e02f9ee0c43bdc703b0f9bd472722446
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317581
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-09-17 19:09:04 +00:00
Herb Derby
02e5c39b86 refactor making a new glyph
Part of this was changing merging the glyph to just punt
if the glyph is already there.

Change-Id: I505e9d24432f77de6e15af46a6d95981bd86d12e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317580
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-09-17 18:32:44 +00:00
Brian Osman
bf2163f267 SkSL: Only allow bitwise ops on integral types
We were allowing these ops on floating point types. The resulting GLSL
would fail to compile. We also allowed >>= and <<= on vectors (but not
any of the other bitwise ops).

The newly added unit tests were failing (eg, not catching errors). New
results are correct.

Bug: skia:10707
Change-Id: I97b769f1ce59261361109a71061b42dc8ef3c74b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317393
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-17 18:12:34 +00:00
John Stiles
6dc5265ae6 Migrate several SkSLFP tests to golden outputs.
Change-Id: I83a38f2c953a560fea3483e95e31df532b90773e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317456
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-17 16:46:18 +00:00
John Stiles
0ed9f31f6a Migrate several GLSL workaround unit tests to golden files.
We now support building an SkSL golden output twice, once honoring the
custom #pragma settings, and once more ignoring the settings. This
allows us to see the output of the workaround technique, alongside the
"default-settings" output which should not contain a workaround.

To implement this, skslc now supports a flag: --[no]settings.
When it's set, /*#pragma settings*/ comments are honored. When it's not
set, skslc ignores the comments. compile_sksl_tests.py passes this flag
along to skslc.

This approach is not strictly limited to workarounds; the
"TypePrecision" GLSL test was also updated to use this technique.

Change-Id: I79204df047b024533ed6bc1f4c088e0e878d5bb1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317246
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-17 16:41:18 +00:00
Mike Klein
dd16cb5974 Add SkVx.h to core.gni
Trying to run Chrome trybots on changes to SkVx.h,
but it's deciding to skip the build...

Change-Id: Ic40cc2eec5db00c4f6eacc72e0e50101a8478e99
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317596
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-17 15:46:18 +00:00
Robert Phillips
12d06a3842 Add plumbing for the GrThreadSafeUniquelyKeyedProxyViewCache
This CL is also imperfect and incomplete but, although currently unused, it sketches in how the threadSafeProxyCache will be plumbed through the GrContexts and GrResourceCache.

Bug: 1108408
Change-Id: Idb012b6efd49291de69bd88e4b4c531458a3e553
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317360
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-09-17 14:15:58 +00:00
Mike Klein
ed423aa542 Revert "update skvx scalar-fallback strategy"
This reverts commit 4985db413d.

Reason for revert:

../../third_party/skia/include/private/SkVx.h:491:14: runtime error: control flow integrity check for type 'float (float)' failed during indirect function call
(/lib/x86_64-linux-gnu/libm.so.6+0x36460): note: (unknown) defined here
../../third_party/skia/include/private/SkVx.h:491:14: note: check failed in /b/s/w/ir/out/Release/viz_unittests, destination function located in /lib/x86_64-linux-gnu/libm.so.6
    #0 0x55e964d3c1f9 in skvx::Vec<4, float> skvx::map_<4, float, float, 0ul, 1ul, 2ul, 3ul>(skvx::Vec<4, float> const&, float (*)(float), std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul>) ./../../third_party/skia/include/private/SkVx.h:491

I don't understand what's wrong here, but I have a better map() coming up anyway.

Original change's description:
> update skvx scalar-fallback strategy
> 
> Turns out Clang's a lot better at auto-vectorizing "obvious" scalar code
> into obvious vector code when it's written out the long way, e.g.
> 
>      F32x4 x = ...;
>      x = { sqrtf(x[0]), sqrtf(x[1]), sqrtf(x[2]), sqrtf(x[3]) };
> 
> vectorizes into sqrtps a lot more reliably than our recurse-onto-scalars
> strategy, and also better than the other naive approach,
> 
>      F32x4 x = ...;
>      for (int i = 0; i < 4; i++) { x[i] = sqrtf(x[i]); }
> 
> So here I've added a map(V, fn) -> V' using C++14 tricks to let the
> compiler handle the expansion of x = { fn(x[0]), fn(x[1]), ...
> fn(x[N-1]) } for any N, and implemented most skvx scalar fallback code
> using that.
> 
> With these now vectorizing well at any N, we can remove any
> specializations we'd written for particular N, really tidying up.
> 
> Over in the SkVM interpreter, this is a big improvement for ceil and
> floor, which were being done 2 floats at a time instead of 8.  They're
> now slimmed way down to
> 
>    shlq       $6, %r13
>    vroundps   $K, (%r12,%r13), %ymm0
>    vroundps   $K, 32(%r12,%r13), %ymm1
>    jmp        ...
> 
> where K is 9 or 10 depending on the op.
> 
> I haven't found a scalar function that Clang will vectorize to vcvtps2pd
> (the rounding one, not truncating vcvttps2pd), so I've kept lrint()
> written the long way, updated to the style I've been using lately with
> specializations inline.
> 
> Change-Id: Ia97abe3c876008228bf62b1daacd6f6140408fc4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317375
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: I27b5eff3328bf2ddf7063ee0dee14a378ff23b89
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317546
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-17 14:10:10 +00:00
Mike Klein
7e8f13e751 Revert "refactor any()/all(), ptest for all()"
This reverts commit e24f7f3de7.

Reason for revert: Build-Win-MSVC-x86_64-Debug


Original change's description:
> refactor any()/all(), ptest for all()
> 
> Part of this is a simple refactor, adapting any() and all() to the new
> style of specialization.
> 
> And with that refactor in place, add AVX2/SSE4.1 for all() using ptest.
> This isn't terribly important, but it does help make Op::asserts run
> faster in the SkVM interpreter.  I like to run with asserts enabled, and
> this makes passing asserts much cheaper---failing asserts are expensive
> still of course, printing to SkDebugf(), etc.
> 
> Change-Id: Iebdeee701fab7c50cce8e457674b565f7dd2ec21
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317422
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: Ib3ecbe93aa9d14b10dd87e8aa247f275c2c3eb67
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317545
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-17 14:08:50 +00:00
Mike Klein
51a7f9559a slightly simplify skvm interpreter asserts
No need to check the condition twice.

This really just makes it easier to find the code that handles
Op::assert in the interpreter more easily... it's the code that uses the
only two vptest instructions (four before this CL).

Change-Id: I890a2e224515d766b29d41ba07ef6f639e6387d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317424
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-17 13:38:18 +00:00
Mike Klein
e24f7f3de7 refactor any()/all(), ptest for all()
Part of this is a simple refactor, adapting any() and all() to the new
style of specialization.

And with that refactor in place, add AVX2/SSE4.1 for all() using ptest.
This isn't terribly important, but it does help make Op::asserts run
faster in the SkVM interpreter.  I like to run with asserts enabled, and
this makes passing asserts much cheaper---failing asserts are expensive
still of course, printing to SkDebugf(), etc.

Change-Id: Iebdeee701fab7c50cce8e457674b565f7dd2ec21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317422
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-17 13:37:58 +00:00
skia-autoroll
e6467c88b6 Roll Chromium from da6c6f8f1a68 to 70a60d856acd (419 revisions)
da6c6f8f1a..70a60d856a

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 scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary: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: scroggo@google.com
Change-Id: I196548e3d9df1ea9d730e81d6d60088b91d9b745
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317498
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-17 05:02:38 +00:00
skia-autoroll
d0fa7479ac Roll ANGLE from 4d3a0f602852 to 0a8a3ea25b36 (21 revisions)
4d3a0f6028..0a8a3ea25b

2020-09-17 courtneygo@google.com Vulkan: Skip nested pow test on NVIDIA, Windows
2020-09-17 timvp@google.com Vulkan: Use linkedShaderStages in GlslangGetShaderSpirvCode()
2020-09-17 jmadill@chromium.org GN: Fix CrOS build due to buggy "defines".
2020-09-17 timvp@google.com Vulkan: Match descriptor pool sizes to descriptor set layouts
2020-09-17 jmadill@chromium.org Test Runner: Fix dirty thread teardown.
2020-09-17 jmadill@chromium.org Run trace tests against Vulkan Mock ICD.
2020-09-16 jmadill@chromium.org GN: Fix missing pkg_config import in GL back-end.
2020-09-16 capn@google.com Validate GLSL attribute location range
2020-09-16 jmadill@chromium.org Test Runner: Handle GTest sharding args.
2020-09-16 syoussefi@chromium.org Vulkan: Change VK suffix to Vk
2020-09-16 cclao@google.com Vulkan: Move mAttachedColorBufferMask to FramebufferState
2020-09-16 syoussefi@chromium.org Change renderbuffer width/height/sample types to GLsizei
2020-09-16 jmadill@chromium.org Show file in internal errors.
2020-09-16 cnorthrop@google.com EGL: Add another config for Mali
2020-09-16 ianelliott@google.com Vulkan: Disable BlitStencilWithFlip test on Win
2020-09-16 jmadill@chromium.org GN: Componentize GL back-end.
2020-09-16 lexa.knyazev@gmail.com Vulkan: Fix blendEnable-02023 VU
2020-09-16 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from e59713d4edda to f105898a102f (6 revisions)
2020-09-16 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SPIRV-Tools from 726af6f78f80 to e8ce4355ae1c (9 revisions)
2020-09-16 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from dc552fcef1fe to b33e0b36a08c (6 revisions)
2020-09-16 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 1960f3b23408 to e4cbd27e4a55 (817 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Bug: chromium:1110800,chromium:1127866,chromium:1128064,chromium:1129075
Tbr: scroggo@google.com
Test: Test:Test: Test: VulkanDescriptorSetTestTest: Test: angle_end2end_testsTest: Test: local GN CrOS build
Change-Id: If64c10acdaf4ec31a69bfe30a297e70bdcdab42c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317501
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-17 04:46:43 +00:00
skia-autoroll
520701e347 Roll dawn from dbd34449af20 to 6419bddd9b0c (3 revisions)
https://dawn.googlesource.com/dawn.git/+log/dbd34449af20..6419bddd9b0c

2020-09-17 hao.x.li@intel.com Add buffer lazy initialization before resolve queries on D3D12
2020-09-16 cwallez@chromium.org Make dawn components support CMake's BUILD_SHARED_LIBS
2020-09-16 cwallez@chromium.org Fix CMake build on Mac

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: I6868a6abacae618d9aac7616ed9942d167a3a59d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317499
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-17 04:42:18 +00:00
skia-autoroll
f9fdf291c5 Roll SwiftShader from b33e0b36a08c to fe878dedd5ad (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/b33e0b36a08c..fe878dedd5ad

2020-09-16 hidehiko@google.com Expand is_linux to is_linux || is_chromeos.

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 scroggo@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: scroggo@google.com
Change-Id: I0711a4c3dca45901e6948faceae6c4d671bbc488
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317500
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-09-17 04:41:38 +00:00
Ethan Nicholas
bf66ffbbd4 Reland "Revert "moved BinaryExpression's data into IRNode""
This reverts commit 1d3e0e0054.

Reason for revert: possibly causing https://task-scheduler.skia.org/task/F1DoniJAddPuEkH9ETTE

Original change's description:
> Revert "Revert "moved BinaryExpression's data into IRNode""
> 
> This reverts commit b61c3a9a01.
> 
> Change-Id: I4689e1f4977fab3233ff492cee06fbc301b5c689
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317386
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

# Not skipping CQ checks because this is a reland.

Change-Id: Id0f3f211f09fbf31b626c648ed141fc6154a450c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317395
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-09-16 22:39:08 +00:00
John Stiles
72664bede4 Add support for #pragma settings comments in SkSL.
This will allow us to write skslc-based golden tests that deviate from
the standalone skslc settings.

This CL provides six options; more will be added as necessary.
- Default (caps)
- UsesPrecisionModifiers (caps)
- Version110 (caps)
- Version450Core (caps)
- ForceHighPrecision (settings flag bit)
- Sharpen (settings flag bit)

Change-Id: I9b779e039b2f0c0ccf43dca226fb4844aff3526b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317237
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-09-16 22:19:58 +00:00
Chinmay Garde
3ee25e942e Don't link against MetalKit when building the base Skia library.
MetalKit was introduced in iOS 9 and contains utilities for building
applications with Metal. None of these utilities actually seem to be in use.
However, linking against MetalKit means Flutter cannot deploy a unified binary
to iOS 8. This patch removes the unused dependency and unblocks Flutter.

Fixes https://github.com/flutter/flutter/issues/64017

Change-Id: I2cf54a1c95b4c3cda96300861598f2cb23f583d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314539
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Xiao Yu <xster@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-09-16 21:17:38 +00:00
Mike Klein
4985db413d update skvx scalar-fallback strategy
Turns out Clang's a lot better at auto-vectorizing "obvious" scalar code
into obvious vector code when it's written out the long way, e.g.

     F32x4 x = ...;
     x = { sqrtf(x[0]), sqrtf(x[1]), sqrtf(x[2]), sqrtf(x[3]) };

vectorizes into sqrtps a lot more reliably than our recurse-onto-scalars
strategy, and also better than the other naive approach,

     F32x4 x = ...;
     for (int i = 0; i < 4; i++) { x[i] = sqrtf(x[i]); }

So here I've added a map(V, fn) -> V' using C++14 tricks to let the
compiler handle the expansion of x = { fn(x[0]), fn(x[1]), ...
fn(x[N-1]) } for any N, and implemented most skvx scalar fallback code
using that.

With these now vectorizing well at any N, we can remove any
specializations we'd written for particular N, really tidying up.

Over in the SkVM interpreter, this is a big improvement for ceil and
floor, which were being done 2 floats at a time instead of 8.  They're
now slimmed way down to

   shlq       $6, %r13
   vroundps   $K, (%r12,%r13), %ymm0
   vroundps   $K, 32(%r12,%r13), %ymm1
   jmp        ...

where K is 9 or 10 depending on the op.

I haven't found a scalar function that Clang will vectorize to vcvtps2pd
(the rounding one, not truncating vcvttps2pd), so I've kept lrint()
written the long way, updated to the style I've been using lately with
specializations inline.

Change-Id: Ia97abe3c876008228bf62b1daacd6f6140408fc4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317375
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-16 20:37:18 +00:00
Brian Osman
152dfbb9fc Remove "Recompiling..." output when building .fp files
Change-Id: I41402dc04d4388217d7f7cd8de9aff8fbb4a3765
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317391
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-16 20:23:08 +00:00
John Stiles
9080540b93 Convert additional GLSL tests to use golden files.
A handful of simplifications were made, but these hew very close to the
original tests and are intended to cover the exact same ground. The
remaining unconverted tests depend on non-default caps bits and will
be updated once caps handling in skslc is fully landed.

Change-Id: I3f3c29bf87f73e501561d7bfcdaabe8acc14b89f
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317390
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-09-16 20:11:17 +00:00
Ethan Nicholas
1d3e0e0054 Revert "Revert "moved BinaryExpression's data into IRNode""
This reverts commit b61c3a9a01.

Change-Id: I4689e1f4977fab3233ff492cee06fbc301b5c689
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317386
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-09-16 20:01:13 +00:00
John Stiles
b23ea385d4 Avoid generating identity swizzles in the IR.
This doesn't affect the results, since the optimizer was already
stripping out identity swizzles, but it saves us from building a node
that we're just going to throw away later.

Change-Id: I61d0e23eafd4596fba4d6268f325c8939ef38dec
Bug: skia:10721
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317378
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-09-16 19:56:18 +00:00
Brian Osman
b25e6e15c6 Remove unnecessary casting from SkSL in GMs
Converts examples to use more idiomatic "user" SkSL,
without extra casts, and taking advantage of swizzle.

Change-Id: I4ad4e7b6563b4f09402855cb125546b015622ced
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317388
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-16 19:56:07 +00:00
Herb Derby
db4a9fbc65 verify there are no glyph searches
This code is overly paranoid, but should be removed soon.
It is just double checking that we have no glyphs
inserted before we insert them from the Renderer
process.

Change-Id: Iaadb229ea034d3d127a9ed191d3fdd77c252a2b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317387
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-09-16 19:36:38 +00:00
Michael Ludwig
395ddc3d51 Reland "Enable novel GrClipStack on bots, disable elsewhere"
This reverts commit f6e0f58b2e.

Reason for revert: benches and tests updated here: https://skia-review.googlesource.com/c/skia/+/317380

Original change's description:
> Revert "Enable novel GrClipStack on bots, disable elsewhere"
> 
> This reverts commit e1ade2ac4a.
> 
> Reason for revert: Need to remove benchmarks that use deprecated SkClipOps first.
> 
> Original change's description:
> > Enable novel GrClipStack on bots, disable elsewhere
> > 
> > As a result of this change, the new GrClipStack will run on all of our
> > default bots. However, the SK_DISABLE_NEW_GR_CLICK_STACK define is used
> > to explicitly disable the clip stack when we build for the Android
> > Framework, Google3, Flutter, and Fuchsia. These projects can have staging
> > controlled from within the skia repo. This CL in chromium also disables
> > the new clip stack: https://chromium-review.googlesource.com/c/chromium/src/+/2412768
> > and must land before this CL does in Skia.
> > 
> > When GrClipStack originally landed, I had it disabled by checking the
> > value of the define SK_USE_NEW_GR_CLICK_STACK for 0 or 1. To be a little
> > simpler, and work with the flutter and fuchsia gn defines, this CL
> > switches GrClipStack control over to SK_DISABLE_NEW_GR_CLICK_STACK and
> > it just checks for whether or not it's defined.
> > 
> > Bug: skia:10205
> > Change-Id: I6b8bd18290844c02839fe99fdf629b48ffd86f27
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317209
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> Change-Id: I14fddccfdea8e91ebad92e55193b0034f8bb28af
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10205
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317377
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

# Not skipping CQ checks because this is a reland.

Bug: skia:10205
Change-Id: I1f26496437ed04a79e9c1058428cdc867ae3be39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317385
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-09-16 19:30:17 +00:00
Brian Osman
ebf91b2872 Remove swizzle helper function for type creation
Change-Id: I7bc393239dbb66c08fbd24eccfc997adc78248c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317103
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-09-16 19:27:57 +00:00
John Stiles
6e49a372de Avoid redundant zeros and ones in swizzle constructor.
Bug: skia:10721
Change-Id: Ib9e51b736bafb6e4493db4f50e9835fbd86c415d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317247
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-16 19:10:37 +00:00
Herb Derby
ef3aadbd27 simplify setMetricsAndImage API
Just return the amount allocated during the merge.
Add TODO to simplify when I'm sure there are no
collisions during the merge.

Change-Id: Ieb568c4096fc547c54303689b232c68d78f3f36b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317382
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-09-16 19:06:17 +00:00
Adlai Holler
2780656ef4 Remove SkSurface::getContext
Change-Id: Ia683f717a5d8c43da5ff0a05219db86ca5bde2e8
Cq-Include-Trybots: luci.skia.skia.primary:Canary-Android,Canary-Chromium,Canary-Flutter,Canary-G3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317109
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-09-16 18:47:18 +00:00
Michael Ludwig
e4b79699ef Use SkClipOp::kIntersect instead of kReplace_ClipOp
This fixes the perf bot crashes from https://skia-review.googlesource.com/c/skia/+/317209
and removes a few other instances of kReplace_ClipOp that are equivalent to the
still supported SkClipOp::kIntersect op. Other than the benchmark case, the GPU
clip stack wasn't hitting these cases but they do need to be updated when the deprecated
ops are fully removed.

At this point, the remaining uses of deprecated clip ops are all in unit tests that
specifically test a clip stack (raster, conservative, or skclipstack) that specifically
supports expanded clip ops and the tests are testing those operations. They can remain
until we remove full support.

Bug: skia:10208
Change-Id: I5703bf43fd41b6addf329190a70c5429d5971240
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317380
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-09-16 18:37:37 +00:00
Ethan Nicholas
b61c3a9a01 Revert "moved BinaryExpression's data into IRNode"
This reverts commit efc8797880.

Reason for revert: breakage due to std::max initializer list

Original change's description:
> moved BinaryExpression's data into IRNode
> 
> This is another step in the process of merging the various IRNodes' data
> into the base class.
> 
> Change-Id: Ide39c240e6178e23bb6fe317dd56addf2ffefcbb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317102
> Commit-Queue: John Stiles <johnstiles@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: Ib8ef629ffa0ff8bb0aeddfa4f42b824e79ce72b6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317384
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-09-16 18:33:29 +00:00
John Stiles
7f6378f7f8 Migrate swizzle tests to golden SkSL files.
This simplifies life when revising the swizzle logic.

Change-Id: I7fc63c0cc845c4741c17c82b3078040264b61ba0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317379
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-16 18:16:07 +00:00
Mike Klein
6d94b65315 good codegen for Op::mul_q14x2
This compiles to...

   ...
   vmovdqa (%r12,%r13), %ymm0
   vmovdqa 32(%r12,%r13), %ymm1
   vpmulhrsw       (%r12,%r14), %ymm0, %ymm0
   vpaddw  %ymm0, %ymm0, %ymm0
   vpmulhrsw       32(%r12,%r14), %ymm1, %ymm1
   vpaddw  %ymm1, %ymm1, %ymm1
   ...

...which looks perfect.  Clever to use vpaddw instead of a shift,
probably saving a byte or two of code.  I've followed suit in the JIT.

Change-Id: Id4b87d6034c8505db892eed0da0afd0ac4d46068
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317363
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-16 17:36:57 +00:00
Mike Klein
7b1620f366 refactor skvx min/max
Implement min and max using if_then_else(y<x,...) on vectors
rather than recursing to std::min/std::max applied to scalars.

But actually, factor out and use naive_if_then_else(), which Clang can
reason through better than it can our specialized if_then_else().  This
lets every min() or max() I've looked at compile down to ideal codegen,
vmaxps, vpminsw, etc, where if you use if_then_else() you'd see the
literal comparison and blend as written.

I've been looking at q14x2 codegen in the interpreter, and most things
were already good, unexpectedly even uavg_q14x2.  The biggest surprise
was how bad the min/max codegen was, and looking back, even the min_f32
and max_f32 codegen is super bad.  This CL fixes all that, leaving us
with the ideal codegen using the specific instruction you'd want,
replacing a giant mess of code that recursed down to scalars.

mul_q14x2 is still bad, but an easy follow up.

Change-Id: I77b5d7c9aa20a9a2f5ceb3e40f1e18ace2a1b5c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317310
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-09-16 17:10:18 +00:00