dri: Allow selective generation of accum. buffer configs
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 8 Feb 2010 19:09:15 +0000 (11:09 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 10 Feb 2010 18:50:28 +0000 (10:50 -0800)
Modify the interface to driCreateConfigs allowing drivers to not
expose configs with an accumuation buffer.  All of the drivers calling
function have been updated to pass true for the accumulation
selector.  This maintains the current behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
16 files changed:
src/gallium/state_trackers/dri/dri_screen.c
src/mesa/drivers/dri/common/utils.c
src/mesa/drivers/dri/common/utils.h
src/mesa/drivers/dri/ffb/ffb_xmesa.c
src/mesa/drivers/dri/i810/i810screen.c
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/mach64/mach64_screen.c
src/mesa/drivers/dri/mga/mga_xmesa.c
src/mesa/drivers/dri/nouveau/nouveau_screen.c
src/mesa/drivers/dri/r128/r128_screen.c
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/drivers/dri/savage/savage_xmesa.c
src/mesa/drivers/dri/sis/sis_screen.c
src/mesa/drivers/dri/swrast/swrast.c
src/mesa/drivers/dri/tdfx/tdfx_screen.c
src/mesa/drivers/dri/unichrome/via_screen.c

index 2052867309c89703aac4ed5f3d7ceafabf39d1d9..4064976b2345ecf9af55d34c682cb9cab144052f 100644 (file)
@@ -157,7 +157,8 @@ dri_fill_in_modes(struct dri_screen *screen,
                                 depth_bits_array, stencil_bits_array,
                                 depth_buffer_factor, back_buffer_modes,
                                 back_buffer_factor,
-                                msaa_samples_array, msaa_samples_factor);
+                                msaa_samples_array, msaa_samples_factor,
+                                GL_TRUE);
    } else {
       __DRIconfig **configs_a8r8g8b8 = NULL;
       __DRIconfig **configs_x8r8g8b8 = NULL;
@@ -170,7 +171,8 @@ dri_fill_in_modes(struct dri_screen *screen,
                                             back_buffer_modes,
                                             back_buffer_factor,
                                             msaa_samples_array,
-                                             msaa_samples_factor);
+                                             msaa_samples_factor,
+                                            GL_TRUE);
       if (pf_x8r8g8b8)
         configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV,
                                             depth_bits_array,
@@ -179,7 +181,8 @@ dri_fill_in_modes(struct dri_screen *screen,
                                             back_buffer_modes,
                                             back_buffer_factor,
                                             msaa_samples_array,
-                                             msaa_samples_factor);
+                                             msaa_samples_factor,
+                                            GL_TRUE);
 
       if (configs_a8r8g8b8 && configs_x8r8g8b8)
         configs = driConcatConfigs(configs_x8r8g8b8, configs_a8r8g8b8);
index 81d026a697cf5402d7e05533717be9adbd37d076..833f9ad232ad5e9ac47d8b03296cd5c31529d406 100644 (file)
@@ -424,7 +424,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
                 const uint8_t * depth_bits, const uint8_t * stencil_bits,
                 unsigned num_depth_stencil_bits,
                 const GLenum * db_modes, unsigned num_db_modes,
-                const uint8_t * msaa_samples, unsigned num_msaa_modes)
+                const uint8_t * msaa_samples, unsigned num_msaa_modes,
+                GLboolean enable_accum)
 {
    static const uint8_t bits_table[4][4] = {
      /* R  G  B  A */
@@ -486,7 +487,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
    __GLcontextModes *modes;
    unsigned i, j, k, h;
    unsigned num_modes;
-   unsigned num_accum_bits = 2;
+   unsigned num_accum_bits = (enable_accum) ? 2 : 1;
 
    switch ( fb_type ) {
       case GL_UNSIGNED_BYTE_3_3_2:
index 2aa6de66c183b317fc29e9bd359adc1688a376fc..02ca3feb739e5cd5f0ee4e086336db0998a2463f 100644 (file)
@@ -104,7 +104,8 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type,
                 const uint8_t * depth_bits, const uint8_t * stencil_bits,
                 unsigned num_depth_stencil_bits,
                 const GLenum * db_modes, unsigned num_db_modes,
-                const uint8_t * msaa_samples, unsigned num_msaa_modes);
+                const uint8_t * msaa_samples, unsigned num_msaa_modes,
+                GLboolean enable_accum);
 
 __DRIconfig **driConcatConfigs(__DRIconfig **a,
                               __DRIconfig **b);
index 6a84651479519751b96e0f019ea82a51932e98cb..7fdf883cdf4d1f8aea12fccae44d8e4f6825d73b 100644 (file)
@@ -658,7 +658,7 @@ ffbFillInModes( __DRIscreen *psp,
                              depth_bits_array, stencil_bits_array,
                              depth_buffer_factor, back_buffer_modes,
                              back_buffer_factor,
-                               msaa_samples_array, 1);
+                             msaa_samples_array, 1, TRUE);
    if (configs == NULL) {
       fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
               __LINE__);
index 476c8013580b451e3f8969a942f8aaf64c4446ee..825a1b5fbe4c682d3a9f9a8f7dc4bc509884164b 100644 (file)
@@ -92,7 +92,7 @@ i810FillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor,
                               back_buffer_modes, back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, TRUE);
     if (configs == NULL) {
        fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
                 __func__, __LINE__ );
index b308ae191040738fcf4fd060f7b65cc0c5bdb807..8344b82f181e8efcd0a49e94300c465de02577dc 100644 (file)
@@ -413,7 +413,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
                                     back_buffer_modes,
                                     ARRAY_SIZE(back_buffer_modes),
                                     msaa_samples_array,
-                                    ARRAY_SIZE(msaa_samples_array));
+                                    ARRAY_SIZE(msaa_samples_array),
+                                    GL_TRUE);
       if (configs == NULL)
         configs = new_configs;
       else
index 5cbfb85627afbd8f4d7c431113636b0e5d61da25..99aad574c8d94c62576b25a9c6c05713de91cf1d 100644 (file)
@@ -119,7 +119,7 @@ mach64FillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor, back_buffer_modes,
                               back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, TRUE);
     if (configs == NULL) {
        fprintf(stderr, "[%s:%u] Error creating FBConfig!\n",
               __func__, __LINE__);
index e7813b63725025620bd5c812b035b1ef303cd706..a0a65cb45127ad0585f5bda7ad3380d8d3deb84f 100644 (file)
@@ -160,7 +160,7 @@ mgaFillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor,
                               back_buffer_modes, back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, TRUE);
     if (configs == NULL) {
        fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
                 __func__, __LINE__ );
index de6328251eab5b0d754252eaedc988f651779b51..6abab8c9656bdce4d281e313883811c152bc128b 100644 (file)
@@ -83,7 +83,8 @@ nouveau_get_configs(void)
                                          back_buffer_modes,
                                          Elements(back_buffer_modes),
                                          msaa_samples,
-                                         Elements(msaa_samples));
+                                         Elements(msaa_samples),
+                                         GL_TRUE);
                assert(config);
 
                configs = configs ? driConcatConfigs(configs, config)
index ef6b5a35c4a25d661003303a53f8ba418af9486d..afc44d46508a9d3c2ba176946c02bf3dc7ccbecf 100644 (file)
@@ -449,7 +449,7 @@ r128FillInModes( __DRIscreen *psp,
                                depth_bits_array, stencil_bits_array,
                                depth_buffer_factor, back_buffer_modes,
                                back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, TRUE);
     if (configs == NULL) {
         fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
                 __LINE__);
index 93b6399a669f3082683c978cb9282f4e0c802414..7d5cdb5843f846e80f33d630cd55a2da30295238 100644 (file)
@@ -293,18 +293,18 @@ radeonFillInModes( __DRIscreen *psp,
                                          depth_bits_array, stencil_bits_array,
                                          depth_buffer_factor, back_buffer_modes,
                                          back_buffer_factor, msaa_samples_array,
-                                         1);
+                                         1, TRUE);
        configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
                                            depth_bits_array, stencil_bits_array,
                                            1, back_buffer_modes, 1,
-                                           msaa_samples_array, 1);
+                                           msaa_samples_array, 1, TRUE);
        configs = driConcatConfigs(configs_r5g6b5, configs_a8r8g8b8);
    } else
        configs = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
                                   depth_bits_array, stencil_bits_array,
                                   depth_buffer_factor,
                                   back_buffer_modes, back_buffer_factor,
-                                  msaa_samples_array, 1);
+                                  msaa_samples_array, 1, TRUE);
 
     if (configs == NULL) {
        fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
@@ -1676,7 +1676,8 @@ __DRIconfig **radeonInitScreen2(__DRIscreen *psp)
                                     back_buffer_modes,
                                     ARRAY_SIZE(back_buffer_modes),
                                     msaa_samples_array,
-                                    ARRAY_SIZE(msaa_samples_array));
+                                    ARRAY_SIZE(msaa_samples_array),
+                                    GL_TRUE);
       if (configs == NULL)
         configs = new_configs;
       else
index 8e879ca41c0c263ac1c2b37d49dc4d6127bcc3f6..788c49fdbe8f24b932746ca888d7fabbb73b7dae 100644 (file)
@@ -939,7 +939,7 @@ savageFillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor,
                               back_buffer_modes, back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, TRUE);
     if (configs == NULL) {
        fprintf( stderr, "[%s:%u] Error creating FBConfig!\n",
                 __func__, __LINE__ );
index cb7ed8a08bbcff2e041e2d2697868566c0bf496f..0b98541732298ddd7a715863b88af0dc7e8b2e6e 100644 (file)
@@ -103,7 +103,7 @@ sisFillInModes(__DRIscreen *psp, int bpp)
    configs = driCreateConfigs(fb_format, fb_type, depth_bits_array,
                              stencil_bits_array, depth_buffer_factor,
                              back_buffer_modes, back_buffer_factor,
-                              msaa_samples_array, 1);
+                              msaa_samples_array, 1, TRUE);
    if (configs == NULL) {
       fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
       return NULL;
index 4e823669bfcf2bb901af161e701cbeba8febc292..40535b03b954cdd57826e327bdf4f870385c7c5f 100644 (file)
@@ -132,7 +132,8 @@ swrastFillInModes(__DRIscreen *psp,
     configs = driCreateConfigs(fb_format, fb_type,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor, back_buffer_modes,
-                              back_buffer_factor, msaa_samples_array, 1);
+                              back_buffer_factor, msaa_samples_array, 1,
+                              GL_TRUE);
     if (configs == NULL) {
        fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
                __LINE__);
index 9f6b35faa28f09fa9ed397a45b1a2bbc1d45f37b..d554bcdc92cea058b23eaae0f4a15fb771dec86b 100644 (file)
@@ -383,7 +383,8 @@ tdfxFillInModes(__DRIscreen *psp,
                            stencil_bits_array,
                            deep ? 2 : 4,
                            db_modes, 2,
-                           msaa_samples_array, 1);
+                           msaa_samples_array, 1,
+                           GL_TRUE);
 }
 
 /**
index 8c91c937c686dd2cc0456bae8617f4d765f5b05f..55125018cc2659625a510563433edf21913a1313 100644 (file)
@@ -354,7 +354,7 @@ viaFillInModes( __DRIscreen *psp,
                               depth_bits_array, stencil_bits_array,
                               depth_buffer_factor, back_buffer_modes,
                               back_buffer_factor,
-                               msaa_samples_array, 1);
+                               msaa_samples_array, 1, TRUE);
     if (configs == NULL) {
        fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
                __LINE__);