Go to file
Mike Klein d0792e6de6 unnest matrix multiply
As written the order that skvm::Builder sees the values passed as
arguments to mad() is dependent on C++ function argument evaluation
order.  This can be counterintuitive, and since skvm::Builder uses the
original order it saw arguments to break ties when reordering programs,
it can affect program order and register pressure.

This change keeps the math happening in the same order, but takes
precise control over when we mention (and thus when we load) each matrix
coefficient.  The program goes from looking like this, loading uniforms
in reverse order that they're needed,

    ...
    r4 = uniform32 arg(0) 4C
    r3 = uniform32 arg(0) 50
    r12 = uniform32 arg(0) 54
    r13 = uniform32 arg(0) 58
    r14 = uniform32 arg(0) 5C
    r14 = mad_f32 r13 r8 r14
    r14 = mad_f32 r12 r9 r14
    r14 = mad_f32 r3 r11 r14
    r14 = mad_f32 r4 r6 r14
    ...

to something nicer like this that reuses the same temporaries to load
and accumulate the uniforms in the order they're needed,

    ...
    r7 = uniform32 arg(0) 5C
    r11 = uniform32 arg(0) 58
    r7 = mad_f32 r11 r8 r7
    r11 = uniform32 arg(0) 54
    r7 = mad_f32 r11 r9 r7
    r11 = uniform32 arg(0) 50
    r7 = mad_f32 r11 r10 r7
    r11 = uniform32 arg(0) 4C
    r7 = mad_f32 r11 r6 r7
    ...

In all this cuts three unnecessary temporary registers from programs
using SkColorFilter_Matrix, and would be enough to get gm/skvm.cpp all
JITing again if all the instructions it used were implemented... (next).

Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_SKVM_BLITTER
Change-Id: Ie03a5da476a49eeb950e74290001a0625cf61177
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253126
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-11-06 19:09:19 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Use QuadHelper and PatternHelper in more places 2019-11-04 20:32:36 +00:00
bin roll GN 2019-09-26 20:34:17 +00:00
build_overrides Update Dawn backend to ToT. This is about 3 months of changes. 2019-10-15 22:26:38 +00:00
dm Reland "Fully embrace skcms types in SkColorSpace API" 2019-11-05 18:36:26 +00:00
docker Fix usage of depot_tools in containers. 2019-10-14 19:38:40 +00:00
docs/examples docs/fiddle: add "incomplete" fiddle. 2019-10-11 18:22:34 +00:00
example Revert "add guard to switch to SkPathTypes" 2019-09-14 19:13:44 +00:00
experimental Reland "Minimal iOS app: Perform present subsequent to flush" 2019-10-14 18:32:37 +00:00
fuzz [fuzzing] Fix skdescriptor deserialize compile 2019-10-23 11:54:14 +00:00
gm friendly wrapper to allocate uniforms 2019-11-05 21:02:34 +00:00
gn Revert "Fully delineate GL usage w/ skia_use_gl" 2019-11-06 17:19:48 +00:00
include friendly wrapper to allocate uniforms 2019-11-05 21:02:34 +00:00
infra Roll recipe dependencies (trivial). 2019-11-06 19:05:39 +00:00
modules Reland "Fix empty run handling in trivial shaper iterators" 2019-11-06 14:32:13 +00:00
platform_tools android_gdbserver: Don't fail when trying to locate nonexistent files 2019-09-16 16:28:33 +00:00
resources [skottie] Streamlined gradient stop merger 2019-11-05 19:44:11 +00:00
samplecode SkColorMatrix cleanup 2019-11-04 15:20:15 +00:00
site [docs] Add skolo-builder to swarmingbots.md 2019-10-30 19:06:48 +00:00
specs [img-decode] Start on proposed new spec 2019-05-06 17:39:19 +00:00
src unnest matrix multiply 2019-11-06 19:09:19 +00:00
tests fix tolerance in read pixels tests 2019-11-06 17:28:03 +00:00
third_party Roll Dawn to ToT. 2019-11-05 20:56:44 +00:00
tools Revert "Fully delineate GL usage w/ skia_use_gl" 2019-11-06 17:19:48 +00:00
.clang-format restore .clang-format 2019-03-21 15:52:32 +00:00
.clang-tidy add google-build-namespaces to clang-tidy checks 2018-12-12 16:33:59 +00:00
.gitignore clean up some .gitignores 2019-05-15 19:55:45 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS build: fix compilation on macOS with 10.14 SDK 2019-10-30 20:18:58 +00:00
BUILD.gn Revert "Fully delineate GL usage w/ skia_use_gl" 2019-11-06 17:19:48 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Roll third_party/externals/angle2 67527cb45293..1d09b983031b (5 commits) 2019-11-06 06:17:13 +00:00
go.mod Update Go deps 2019-10-24 05:26:54 +00:00
go.sum Blacklist bulkrect benchmarks on chorizo 2019-10-28 22:04:15 +00:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
OWNERS add OWNERS file 2017-12-01 19:50:19 +00:00
PRESUBMIT.py Use urllib_request instead of urllib2 in PRESUBMIT. 2019-10-22 20:30:56 +00:00
public.bzl SkPDF/bublic.bzl: switch away from Sfntly subsetter. 2019-11-05 20:56:05 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
RELEASE_NOTES.txt Reland "Fully embrace skcms types in SkColorSpace API" 2019-11-05 18:36:26 +00:00
whitespace.txt Whitespace test 2019-05-18 13:05:29 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.