depth_buffer_factor, back_buffer_modes,
ARRAY_SIZE(back_buffer_modes),
msaa_modes, 1,
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
configs = driConcatConfigs(configs, new_configs);
/* Multi-sample configs without an accumulation buffer. */
depth_buffer_factor, back_buffer_modes,
ARRAY_SIZE(back_buffer_modes),
msaa_modes+1, num_msaa_modes-1,
- GL_FALSE);
+ GL_FALSE, GL_FALSE);
configs = driConcatConfigs(configs, new_configs);
}
}
* \param msaa_samples Array of msaa sample count. 0 represents a visual
* without a multisample buffer.
* \param num_msaa_modes Number of entries in \c msaa_samples.
- * \param visType GLX visual type. Usually either \c GLX_TRUE_COLOR or
- * \c GLX_DIRECT_COLOR.
+ * \param enable_accum Add an accum buffer to the configs
+ * \param color_depth_match Whether the color depth must match the zs depth
+ * This forces 32-bit color to have 24-bit depth, and
+ * 16-bit color to have 16-bit depth.
*
* \returns
* Pointer to any array of pointers to the \c __DRIconfig structures created
unsigned num_depth_stencil_bits,
const GLenum * db_modes, unsigned num_db_modes,
const uint8_t * msaa_samples, unsigned num_msaa_modes,
- GLboolean enable_accum)
+ GLboolean enable_accum, GLboolean color_depth_match)
{
static const uint32_t masks_table[][4] = {
/* MESA_FORMAT_B5G6R5_UNORM */
for ( i = 0 ; i < num_db_modes ; i++ ) {
for ( h = 0 ; h < num_msaa_modes; h++ ) {
for ( j = 0 ; j < num_accum_bits ; j++ ) {
+ if (color_depth_match &&
+ (depth_bits[k] || stencil_bits[k])) {
+ /* Depth can really only be 0, 16, 24, or 32. A 32-bit
+ * color format still matches 24-bit depth, as there
+ * is an implicit 8-bit stencil. So really we just
+ * need to make sure that color/depth are both 16 or
+ * both non-16.
+ */
+ if ((depth_bits[k] + stencil_bits[k] == 16) !=
+ (red_bits + green_bits + blue_bits + alpha_bits == 16))
+ continue;
+ }
+
*c = malloc (sizeof **c);
modes = &(*c)->modes;
c++;
unsigned num_depth_stencil_bits,
const GLenum * db_modes, unsigned num_db_modes,
const uint8_t * msaa_samples, unsigned num_msaa_modes,
- GLboolean enable_accum);
+ GLboolean enable_accum, GLboolean color_depth_match);
__DRIconfig **driConcatConfigs(__DRIconfig **a,
__DRIconfig **b);
num_depth_stencil_bits,
back_buffer_modes, 2,
singlesample_samples, 1,
- false);
+ false, false);
configs = driConcatConfigs(configs, new_configs);
}
depth_bits, stencil_bits, 1,
back_buffer_modes, 1,
singlesample_samples, 1,
- true);
+ true, false);
configs = driConcatConfigs(configs, new_configs);
}
num_depth_stencil_bits,
back_buffer_modes, 2,
singlesample_samples, 1,
- false);
+ false, false);
configs = driConcatConfigs(configs, new_configs);
}
depth_bits, stencil_bits, 1,
back_buffer_modes, 1,
singlesample_samples, 1,
- true);
+ true, false);
configs = driConcatConfigs(configs, new_configs);
}
back_buffer_modes, 1,
multisample_samples,
num_msaa_modes,
- false);
+ false, false);
configs = driConcatConfigs(configs, new_configs);
}
ARRAY_SIZE(back_buffer_modes),
msaa_samples,
ARRAY_SIZE(msaa_samples),
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
assert(config);
configs = driConcatConfigs(configs, config);
ARRAY_SIZE(back_buffer_modes),
msaa_samples_array,
ARRAY_SIZE(msaa_samples_array),
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
configs = driConcatConfigs(configs, new_configs);
}
depth_bits_array, stencil_bits_array,
depth_buffer_factor, back_buffer_modes,
back_buffer_factor, msaa_samples_array, 1,
- GL_TRUE);
+ GL_TRUE, GL_FALSE);
if (configs == NULL) {
fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
__LINE__);