[Mesa3d-dev] [PATCH 4/6] dri: Allow selective generation of accum. buffer configs
From: Ian Romanick 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. --- src/mesa/drivers/dri/common/utils.c |5 +++-- src/mesa/drivers/dri/common/utils.h |3 ++- src/mesa/drivers/dri/ffb/ffb_xmesa.c |2 +- src/mesa/drivers/dri/i810/i810screen.c|2 +- src/mesa/drivers/dri/intel/intel_screen.c |3 ++- src/mesa/drivers/dri/mach64/mach64_screen.c |2 +- src/mesa/drivers/dri/mga/mga_xmesa.c |2 +- src/mesa/drivers/dri/nouveau/nouveau_screen.c |3 ++- src/mesa/drivers/dri/r128/r128_screen.c |2 +- src/mesa/drivers/dri/radeon/radeon_screen.c |9 + src/mesa/drivers/dri/savage/savage_xmesa.c|2 +- src/mesa/drivers/dri/sis/sis_screen.c |2 +- src/mesa/drivers/dri/swrast/swrast.c |3 ++- src/mesa/drivers/dri/tdfx/tdfx_screen.c |3 ++- src/mesa/drivers/dri/unichrome/via_screen.c |2 +- 15 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 81d026a..833f9ad 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -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: diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 2aa6de6..02ca3fe 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -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); diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index 6a84651..7fdf883 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -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__); diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 476c801..825a1b5 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -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__ ); diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index b308ae1..8344b82 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -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), +
Re: [Mesa3d-dev] [PATCH 4/6] dri: Allow selective generation of accum. buffer configs
>From what I understand from my research, accumulation buffers are typically specific to fixed-function chipsets, right? So not all of these drivers will prefer to expose the accumbuf visuals, and those that do probably don't want to advertise them as CAVEAT_SLOW. Also, Gallium's dri state tracker needs to be changed to respect this when calling driCreateConfigs. Otherwise this looks fine. ~ C. On Mon, Feb 8, 2010 at 5:09 PM, Ian Romanick wrote: > From: Ian Romanick > > 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. > --- > src/mesa/drivers/dri/common/utils.c | 5 +++-- > src/mesa/drivers/dri/common/utils.h | 3 ++- > src/mesa/drivers/dri/ffb/ffb_xmesa.c | 2 +- > src/mesa/drivers/dri/i810/i810screen.c | 2 +- > src/mesa/drivers/dri/intel/intel_screen.c | 3 ++- > src/mesa/drivers/dri/mach64/mach64_screen.c | 2 +- > src/mesa/drivers/dri/mga/mga_xmesa.c | 2 +- > src/mesa/drivers/dri/nouveau/nouveau_screen.c | 3 ++- > src/mesa/drivers/dri/r128/r128_screen.c | 2 +- > src/mesa/drivers/dri/radeon/radeon_screen.c | 9 + > src/mesa/drivers/dri/savage/savage_xmesa.c | 2 +- > src/mesa/drivers/dri/sis/sis_screen.c | 2 +- > src/mesa/drivers/dri/swrast/swrast.c | 3 ++- > src/mesa/drivers/dri/tdfx/tdfx_screen.c | 3 ++- > src/mesa/drivers/dri/unichrome/via_screen.c | 2 +- > 15 files changed, 26 insertions(+), 19 deletions(-) > > diff --git a/src/mesa/drivers/dri/common/utils.c > b/src/mesa/drivers/dri/common/utils.c > index 81d026a..833f9ad 100644 > --- a/src/mesa/drivers/dri/common/utils.c > +++ b/src/mesa/drivers/dri/common/utils.c > @@ -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: > diff --git a/src/mesa/drivers/dri/common/utils.h > b/src/mesa/drivers/dri/common/utils.h > index 2aa6de6..02ca3fe 100644 > --- a/src/mesa/drivers/dri/common/utils.h > +++ b/src/mesa/drivers/dri/common/utils.h > @@ -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); > diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c > b/src/mesa/drivers/dri/ffb/ffb_xmesa.c > index 6a84651..7fdf883 100644 > --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c > +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c > @@ -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__); > diff --git a/src/mesa/drivers/dri/i810/i810screen.c > b/src/mesa/drivers/dri/i810/i810screen.c > index 476c801..825a1b5 100644 > --- a/src/mesa/drivers/dri/i810/i810screen.c > +++ b/src/mesa/drivers/dri/i810/i810screen.c > @@ -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__ ); > diff --git a/src/mesa/drivers/dri/in
Re: [Mesa3d-dev] [PATCH 4/6] dri: Allow selective generation of accum. buffer configs
On Mon, Feb 08, 2010 at 05:09:58PM -0800, Ian Romanick wrote: > From: Ian Romanick > > 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. What's the gain? You don't (and probably won't) remove code, so that's just removing functionality for the sake of removing functionality. So what's the point, short of "the current x11/glx visual concept is outdated and a capability request would be better"? OG. -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
Re: [Mesa3d-dev] [PATCH 4/6] dri: Allow selective generation of accum. buffer configs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Olivier Galibert wrote: > On Mon, Feb 08, 2010 at 05:09:58PM -0800, Ian Romanick wrote: >> From: Ian Romanick >> >> 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. > > What's the gain? You don't (and probably won't) remove code, so > that's just removing functionality for the sake of removing > functionality. So what's the point, short of "the current x11/glx > visual concept is outdated and a capability request would be better"? Please refer to the previous thread for the rationale: http://marc.info/?l=mesa3d-dev&m=126540374515271&w=2 No *functionality* is removed. If you look at patch 5 in the series, I've only reduced the number of visuals with accumulation buffer that are exposed. The accum visuals that are exposed a full featured (i.e., double buffered, depth, and stencil), so any applications that may require an accumulation buffer will not lose any capabilities. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktxrYkACgkQX1gOwKyEAw+hIACfaigJv4KfwdL+GT+o9ZDDd2t4 AhIAoIR3fzW6eB9UlWy00LljkglUzF4C =AT0c -END PGP SIGNATURE- -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
Re: [Mesa3d-dev] [PATCH 4/6] dri: Allow selective generation of accum. buffer configs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Corbin Simpson wrote: >>From what I understand from my research, accumulation buffers are > typically specific to fixed-function chipsets, right? So not all of > these drivers will prefer to expose the accumbuf visuals, and those > that do probably don't want to advertise them as CAVEAT_SLOW. Also, > Gallium's dri state tracker needs to be changed to respect this when > calling driCreateConfigs. Previous to OpenGL 3.1 and in OpenGL 3.1 with GL_ARB_compatibility, implementations are required to expose at least one configuration with an accumulation buffer. Marking them as slow has always been a bit dubious. They are marked this way because the accumulation operation is done in software, but everything else runs as normal. The GLX spec says: "...if it is set to GLX_SLOW_CONFIG then rendering to a drawable with this configuration may run at reduced performance (for example, the hardware may not support the color buffer depths described by the cnfiguration)..." This isn't exactly the case with visual with accumulation buffer. It's just some operations that are slow, and that's always possible. Since these visuals have been marked like this since day-1, I'm not inclined to change them now. > Otherwise this looks fine. Can I consider that a 'Reviewed-by:'? :) -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktxra8ACgkQX1gOwKyEAw9tBACgl/DE+d3oCjAPDGgXp87Ojli9 JXsAoJn5Gn3VTWr/I1M3oTJxwWKLDhck =rZ6v -END PGP SIGNATURE- -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
Re: [Mesa3d-dev] [PATCH 4/6] dri: Allow selective generation of accum. buffer configs
On Tue, Feb 9, 2010 at 10:47 AM, Ian Romanick wrote: > Corbin Simpson wrote: >> Otherwise this looks fine. > > Can I consider that a 'Reviewed-by:'? :) Could I get a version that also fixes Gallium, or should I provide that? :3 Reviewed-by: Corbin Simpson ~ C. -- Only fools are easily impressed by what is only barely beyond their reach. ~ Unknown Corbin Simpson -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev