This patch series provides preliminary support for MSAA (multisample antialiasing) in i965/gen6.
The key difficulty in implementing MSAA is that we have to allow the user to blit between arbitrary combinations of MSAA and non-MSAA renderbuffers. In particular, we need to be able to blit from an MSAA buffer to a non-MSAA buffer, and in doing so, blend all of the constituent samples from one pixel together into a single color value. We can't do this using the hardware blitter or the existing blit meta-op, since neither mechanism supports blending together the constituent samples. Also, MSAA surfaces must be Y-tiled, and the hardware blitter doesn't support Y tiling. This leaves two possibilities: extend the meta-op to be able to perform the necessary blending, or do the blit using the GPU's 3D render path and some custom shader programs written in GPU assembly. I've chosen the latter alternative, since this will allow the blit to be faster (especially on Gen7, where it is possible to recognize pixels that do not need blending and avoid extra texel fetches). An additional benefit of this approach is that we will be able to re-use this "blit using the render path" mechanism to speed up operations that are currently done on the CPU (such as copying data between a depth/stencil buffer and a separate stencil buffer). In order to perform blits using the render path, I've re-purposed the existing HiZ code into a more general purpose component called "blorp", which stands for "BLit Or Resolve Pass"*. Most of the patches that follow simply reorganize the HiZ code into a form which allows blitting functionality to be added to it. The second-to-last patch in the series actually adds blitting capability, and the last patch adds MSAA support. MSAA support is still preliminary; however since the driver *claims* to support GL 3.0 (and MSAA is a required part of GL 3.0), I think it is reasonable to turn it on now and address the remaining limitations as future "bug fix" patches. Most of the work left to do is documented in "TODO" comments in the patches to follow (the two exceptions are centroid interpolation and coverage parameters, which I haven't yet started on). *Another possible backronym for "blorp" is "BLit On Render Path", but sadly this doesn't convey the fact that the code is still used for HiZ resolves. [PATCH 01/10] intel: Add extern "C" declarations to headers [PATCH 02/10] intel: Work around differences between C and C++ scoping rules. [PATCH 03/10] i965/hiz: Make void pointer type casts explicit [PATCH 04/10] i965/hiz: Convert gen{6,7}_hiz.c to C++ [PATCH 05/10] i965/hiz: Convert gen{6,7}_hiz.h to gen{6,7}_blorp.h [PATCH 06/10] i965: Parameterize HiZ code to prepare for adding blitting. [PATCH 07/10] i965: split gen{6,7}_blorp_exec functions into manageable chunks. [PATCH 08/10] i965: Expose surface setup internals for use by blits. [PATCH 09/10] i965/gen6+: Add code to perform blits on the render path ("blorp"). [PATCH 10/10] i965/gen6: Initial implementation of MSAA. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev