summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2020-10-13 16:01:31 -0700
committerIan Romanick <ian.d.romanick@intel.com>2020-10-15 12:40:25 -0700
commit57db4c47af7581f5caa6b888ecc496444c4c718f (patch)
tree18c34cde72418889ba67d59106375eecab5d0fa8
parent19aaafd4a667fb843a1c7727de23ff87179d9eb5 (diff)
gallium/dri2: Expose fewer visuals with accumulation buffer
Even for the few, ancient applications that /might/ use accumulation buffer, 565 color and fp16 color don't make any sense.
-rw-r--r--src/gallium/frontends/dri/dri_screen.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c
index f476333d295..83d48b474a1 100644
--- a/src/gallium/frontends/dri/dri_screen.c
+++ b/src/gallium/frontends/dri/dri_screen.c
@@ -287,6 +287,21 @@ dri_fill_in_modes(struct dri_screen *screen)
PIPE_BIND_DISPLAY_TARGET))
continue;
+ /* There are very few applications that use accumulation buffer, and
+ * nearly all of those are OpenGL 1.x. Most likely, these applications
+ * are doing higher quality rendering, so they won't want 16-bit color.
+ * They also pre-date floating-poing color, so they probably won't want
+ * that either. Since the accumulation buffer is itself only 16-bits
+ * per channel, there wouldn't be much point.
+ *
+ * SGI supported accumulation with some deeper unorm formats, but we
+ * don't expose visuals for those anyway.
+ */
+ const bool enable_accumulation =
+ mesa_formats[format] != MESA_FORMAT_RGBA_FLOAT16 &&
+ mesa_formats[format] != MESA_FORMAT_RGBX_FLOAT16 &&
+ mesa_formats[format] != MESA_FORMAT_B5G6R5_UNORM;
+
for (i = 1; i <= msaa_samples_max; i++) {
int samples = i > 1 ? i : 0;
@@ -298,13 +313,16 @@ dri_fill_in_modes(struct dri_screen *screen)
}
if (num_msaa_modes) {
- /* Single-sample configs with an accumulation buffer. */
+ /* Single-sample configs possibly with an accumulation buffer. See
+ * enable_accumulation above.
+ */
new_configs = driCreateConfigs(mesa_formats[format],
depth_bits_array, stencil_bits_array,
depth_buffer_factor, back_buffer_modes,
ARRAY_SIZE(back_buffer_modes),
msaa_modes, 1,
- GL_TRUE, !mixed_color_depth, GL_FALSE);
+ enable_accumulation, !mixed_color_depth,
+ GL_FALSE);
configs = driConcatConfigs(configs, new_configs);
/* Multi-sample configs without an accumulation buffer. */