summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-08-09 17:22:35 +0200
committerMarek Olšák <[email protected]>2012-08-15 19:20:58 +0200
commit1932bc8aaeb59287a7f769b0cb9a55f49dd6d553 (patch)
tree3eb266e96c617de7bb517595940990f4639e410d /src
parent870af19d70bf985a253f1ea8398fb7ec8704cf9c (diff)
r600g: enable MSAA on evergreen by default
v2: add the DRM version check
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r600/evergreen_state.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index f9c7b52d55d..89f27b44497 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -620,6 +620,7 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
unsigned sample_count,
unsigned usage)
{
+ struct r600_screen *rscreen = (struct r600_screen*)screen;
unsigned retval = 0;
if (target >= PIPE_MAX_TEXTURE_TYPES) {
@@ -630,9 +631,29 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
if (!util_format_is_supported(format, usage))
return FALSE;
- /* Multisample */
- if (sample_count > 1)
- return FALSE;
+ if (sample_count > 1) {
+ if (rscreen->info.drm_minor < 19)
+ return FALSE;
+
+ if (rscreen->chip_class != EVERGREEN)
+ return FALSE;
+
+ switch (sample_count) {
+ case 2:
+ case 4:
+ case 8:
+ break;
+ default:
+ return FALSE;
+ }
+
+ /* require render-target support for multisample resources */
+ if (util_format_is_depth_or_stencil(format)) {
+ usage |= PIPE_BIND_DEPTH_STENCIL;
+ } else {
+ usage |= PIPE_BIND_RENDER_TARGET;
+ }
+ }
if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
r600_is_sampler_format_supported(screen, format)) {