[cairo] The right approach to projective transformations

James Cloos cloos at jhcloos.com
Fri Aug 20 12:54:37 PDT 2010

In addition to Bill's and Andrea's comments, I'd note that although the
api should be an arbitrary 3x3 matrix and 3-value vectors, the layout in
memory should be 4x4 matrices and 4-valued vectors so that the arithmetic
can be accelerated.  The 128-bit vector size was chosen specifically to
optimize 4x4 matrices with each other and with 4x1 & 1x4 vectors.

If the api provides no way to set the z row or the z column, then the
non-simd paths can presume z=[0 0 0 0] and just skip over those entires.

It should be good for up to a 9/4 or so speed up over scalar arithmetic,
depending on the details of the hw.

James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

More information about the cairo mailing list