diff options
author | Marek Olšák <[email protected]> | 2013-01-05 06:21:49 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-01-06 14:44:12 +0100 |
commit | 8ed6b1400bc8a78f46340f41aaf2e88b24c23267 (patch) | |
tree | 56cddcccd509040b3b38bed2b1929408bbe9f1b5 /src/gallium/drivers/r300/r300_screen.c | |
parent | cc030da4284b6c965d2b72c68a875b3210a4b286 (diff) |
r300g: implement MSAA
This is not as optimized as r600g - the MSAA compression is missing,
so r300g needs a lot of bandwidth (more than r600g to do the same thing).
However, if the bandwidth is not an issue for you, you can enjoy this
unoptimized MSAA support.
The only other missing optimization for MSAA is the fast color clear.
MSAA is enabled on r500 only, because that's the only GPU family I tested.
That said, MSAA should work on r300 and r400 as well (but you must set
RADEON_MSAA=1 to allow it, then turn MSAA on in your app or set GALLIUM_MSAA=n,
n >= 2, n <= 6)
I will enable the support by default on r300-r400 once someone (other than me)
tests those chipsets with piglit.
The supported modes are 2x, 4x, 6x.
The supported MSAA formats are RGBA8, BGRA8, and RGBA16F (r500 only).
Those 3 formats are used for all GL internal formats.
Tested with piglit. (I have ported all MSAA tests to GL2.1)
Diffstat (limited to 'src/gallium/drivers/r300/r300_screen.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_screen.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index db8f171786d..762f6072e0c 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -392,17 +392,34 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, case 1: break; case 2: - case 3: case 4: case 6: - return FALSE; -#if 0 - if (usage != PIPE_BIND_RENDER_TARGET || + /* We need DRM 2.8.0. */ + if (!drm_2_8_0) { + return FALSE; + } + /* Only support R500, because I didn't test older chipsets, + * but MSAA should work there too. */ + if (!is_r500 && !debug_get_bool_option("RADEON_MSAA", FALSE)) { + return FALSE; + } + /* No texturing and scanout. */ + if (usage & (PIPE_BIND_SAMPLER_VIEW | + PIPE_BIND_DISPLAY_TARGET | + PIPE_BIND_SCANOUT)) { + return FALSE; + } + /* Only allow depth/stencil, RGBA8, RGBA16F */ + if (!util_format_is_depth_or_stencil(format) && !util_format_is_rgba8_variant( - util_format_description(format))) { + util_format_description(format)) && + format != PIPE_FORMAT_R16G16B16A16_FLOAT) { + return FALSE; + } + /* RGBA16F AA is only supported on R500. */ + if (format == PIPE_FORMAT_R16G16B16A16_FLOAT && !is_r500) { return FALSE; } -#endif break; default: return FALSE; |