This patch enables multisample antialiasing in the OpenSWR software renderer.
MSAA is a proof-of-concept/work-in-progress with bug fixes and performance on the way. We wanted to get the changes out now to allow several customers to begin experimenting with MSAA in a software renderer. So as not to impact current customers, MSAA is turned off by default - previous functionality and performance remain intact. It is easily enabled via environment variables, as described below.
It has only been tested with the glx-lib winsys. The intention is to enable other state-trackers, both Windows and Linux and more fully support FBOs.
There are 2 environment variables that affect behavior:
- SWR_MSAA_FORCE_ENABLE - force MSAA on, for apps that are not designed for MSAA... Beware, results will vary. This is mainly for testing.
- SWR_MSAA_MAX_SAMPLE_COUNT - sets maximum supported number of samples (1,2,4,8,16), or 0 to disable MSAA altogether. (The default is currently 0.)
1832ef6 swr: Enable MSAA in OpenSWR software renderer
src/gallium/drivers/swr/swr_context.cpp | 90 +++++++++++++++++-
src/gallium/drivers/swr/swr_context.h | 3 +
src/gallium/drivers/swr/swr_resource.h | 4 +
src/gallium/drivers/swr/swr_screen.cpp | 159 +++++++++++++++++++++++++++++---
src/gallium/drivers/swr/swr_screen.h | 8 ++
src/gallium/drivers/swr/swr_state.cpp | 74 +++++++++++++--
6 files changed, 313 insertions(+), 25 deletions(-)