st/dri: don't expose MSAA configs with accumulation buffer
authorMarek Olšák <maraeo@gmail.com>
Mon, 3 Dec 2012 02:40:43 +0000 (03:40 +0100)
committerMarek Olšák <maraeo@gmail.com>
Fri, 7 Dec 2012 13:19:28 +0000 (14:19 +0100)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/state_trackers/dri/common/dri_screen.c

index 96efa1f63ea2f518dd0c53e4b2c649968c842995..df2cd3f6b379ca8d446d19616f28b4a48ca563d5 100644 (file)
@@ -164,13 +164,25 @@ dri_fill_in_modes(struct dri_screen *screen)
       }
 
       if (num_msaa_modes) {
+         /* Single-sample configs with an accumulation buffer. */
          new_configs = driCreateConfigs(mesa_formats[format],
                                         depth_bits_array, stencil_bits_array,
                                         depth_buffer_factor, back_buffer_modes,
                                         Elements(back_buffer_modes),
-                                        msaa_modes, num_msaa_modes,
+                                        msaa_modes, 1,
                                         GL_TRUE);
          configs = driConcatConfigs(configs, new_configs);
+
+         /* Multi-sample configs without an accumulation buffer. */
+         if (num_msaa_modes > 1) {
+            new_configs = driCreateConfigs(mesa_formats[format],
+                                           depth_bits_array, stencil_bits_array,
+                                           depth_buffer_factor, back_buffer_modes,
+                                           Elements(back_buffer_modes),
+                                           msaa_modes+1, num_msaa_modes-1,
+                                           GL_FALSE);
+            configs = driConcatConfigs(configs, new_configs);
+         }
       }
    }