Commit Graph

5 Commits

Author SHA1 Message Date
Chris Dalton
356cef301b Simplify grvx::approx_angle_between_vectors signature
Rather than taking the x and y values separately (ax, ay, bx, by),
simply take two vec<N*2>'s (a, b), where the x's are in a.lo and the
y's in a.hi.

Bug: skia:10419
Change-Id: I21d659c79247ccb625351c20b93c550d0afffe79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339458
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-01 16:16:42 +00:00
Chris Dalton
d461f6eb22 Add support for strided loads to GrVx
Bug: skia:10419
Change-Id: I050d8ed49e3a2a6d12b889961e8886f671e2d170
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337561
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-11-23 22:50:33 +00:00
Chris Dalton
6bacd9ff2f Fix the grvx_approx_angle_between_vectors test
This method is only valid in the range 2^(+/-30) due to fp32 overflow.
Adds a comment to the function and updates its test.

TBR=bsalomon@google.com
Change-Id: Ifa2fc0ed4a7f9123f0bebaa02c666c61e06e62a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331481
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-11-03 00:27:54 +00:00
Chris Dalton
4195bcc25a Use uint4 instead if int4 in grvx test
Change-Id: Ic0a4c433d1d78592613b8a2fc10098ea74ee250e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331368
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-02 20:04:24 +00:00
Chris Dalton
c3cb099556 Add GrVx.h
Adds grvx, Ganesh's addendum to skvx. Here we introduce familiar names
and operations from GPU languages, as well as functions that are
approximate and/or have LSB differences from platform to platform.

The initial implementation has: fast_fma, fast_acos, and
fast_angle_between_vectors. When a function is approximate, its error
range is well documented and tested.

Also establishes GrWangsFormula as the first user of grvx.

Bug: skia:10419
Change-Id: Id0682599cf9c0303eff386095afc3ef9f3a7fa1b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330119
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-02 18:33:54 +00:00