From 1832ef6cd9bdce4f546128c0b77d7acd6fd898a7 Mon Sep 17 00:00:00 2001 From: Bruce Cherniak Date: Thu, 13 Apr 2017 17:40:11 -0500 Subject: swr: Enable MSAA in OpenSWR software renderer 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.) Reviewed-by: George Kyriazis --- src/gallium/drivers/swr/swr_resource.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gallium/drivers/swr/swr_resource.h') diff --git a/src/gallium/drivers/swr/swr_resource.h b/src/gallium/drivers/swr/swr_resource.h index 41abd77cba0..ae9954c1e7d 100644 --- a/src/gallium/drivers/swr/swr_resource.h +++ b/src/gallium/drivers/swr/swr_resource.h @@ -46,6 +46,10 @@ struct swr_resource { struct sw_displaytarget *display_target; + /* If resource is multisample, then this points to a alternate resource + * containing the resolved multisample surface, otherwise null */ + struct pipe_resource *resolve_target; + size_t mip_offsets[PIPE_MAX_TEXTURE_LEVELS]; size_t secondary_mip_offsets[PIPE_MAX_TEXTURE_LEVELS]; -- cgit v1.2.3