summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-02-08 11:21:29 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-02-10 10:50:28 -0800
commitbb65a1d009e3d8398492aa30d944c17a40535aa1 (patch)
tree3f6cae98756822d542f6a23603b81fd071f4cdd1 /src/mesa/drivers
parent3cce4a1e10361458630511543b7a8a6438544775 (diff)
intel: Expose a minimal number of configs with accumulation buffer
Expose one config per color depth that includes accumulation buffer. We could probably expose only one config with accumulation buffer, but that would require figuring out the actual color depth. This is easier and only exposes 2 useless configs. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 8344b82f18..551b97e42a 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -388,6 +388,9 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
depth_bits[0] = 0;
stencil_bits[0] = 0;
+ /* Generate a rich set of useful configs that do not include an
+ * accumulation buffer.
+ */
for (color = 0; color < ARRAY_SIZE(fb_format); color++) {
__DRIconfig **new_configs;
int depth_factor;
@@ -414,6 +417,31 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
ARRAY_SIZE(back_buffer_modes),
msaa_samples_array,
ARRAY_SIZE(msaa_samples_array),
+ GL_FALSE);
+ if (configs == NULL)
+ configs = new_configs;
+ else
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ /* Generate the minimum possible set of configs that include an
+ * accumulation buffer.
+ */
+ for (color = 0; color < ARRAY_SIZE(fb_format); color++) {
+ __DRIconfig **new_configs;
+
+ if (fb_type[color] == GL_UNSIGNED_SHORT_5_6_5) {
+ depth_bits[0] = 16;
+ stencil_bits[0] = 0;
+ } else {
+ depth_bits[0] = 24;
+ stencil_bits[0] = 8;
+ }
+
+ new_configs = driCreateConfigs(fb_format[color], fb_type[color],
+ depth_bits, stencil_bits, 1,
+ back_buffer_modes + 1, 1,
+ msaa_samples_array, 1,
GL_TRUE);
if (configs == NULL)
configs = new_configs;