llvmpipe: Add a linear rasterizer optimized for 2D rendering.
This change adds:
-
an alternative rasterizer, which rasterizes bins in a left->right & top->bottom linear fashion;
-
triangle -> rectangle detection;
-
1:1 blit detection;
-
a special TGSI -> LLVM IR code generation that uses 8-bit SSE integers in AoS fashion (as opposed to 32bits floats.)
Altogether these changes yield a 2x to 3x performance improvement for 2D workloads. It was designed to render Windows 7 Aero and other Windows built-in 3D applications (like Windows Media Player, Internet Explorer 11, UWP applications) with minimum CPU utilization, but it should be generally applicable to other 2D-on-3D applications, like desktop compositors, HTML browsers, 3D based UI toolkits, etc.
This was mostly the brainchild of Keith Whitwell back in 2010. I wrote TGSI -> AoS translation. And many others added bug-fixes and enhancements over the years: Roland Scheidegger, Brian Paul, and James Benton.
Known issues:
-
piglit spec@!opengl 1.1@quad-invariance will warn that "left and right half should match" due to rounding error difference
-
These optimized paths to kick in is that depth-buffer must not be used, so some applications which want to benefit from these improvements might need to be modified to ensure they use painter's algorithm instead of depth-buffers.