d0792e6de6
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> |
||
---|---|---|
animations | ||
bench | ||
bin | ||
build_overrides | ||
dm | ||
docker | ||
docs/examples | ||
example | ||
experimental | ||
fuzz | ||
gm | ||
gn | ||
include | ||
infra | ||
modules | ||
platform_tools | ||
resources | ||
samplecode | ||
site | ||
specs | ||
src | ||
tests | ||
third_party | ||
tools | ||
.clang-format | ||
.clang-tidy | ||
.gitignore | ||
.gn | ||
AUTHORS | ||
BUILD.gn | ||
codereview.settings | ||
CONTRIBUTING | ||
CQ_COMMITTERS | ||
DEPS | ||
go.mod | ||
go.sum | ||
LICENSE | ||
OWNERS | ||
PRESUBMIT.py | ||
public.bzl | ||
README | ||
README.chromium | ||
RELEASE_NOTES.txt | ||
whitespace.txt |
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. See full details, and build instructions, at https://skia.org.