diff options
author | Ian Romanick <[email protected]> | 2004-02-27 19:12:29 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2004-02-27 19:12:29 +0000 |
commit | 1cb11ce1c50feb1b911545a793934158097a0f44 (patch) | |
tree | 65ad9be000e63d1250fddc3712b8177fd449651a /src | |
parent | ad1e06fafe8061984fd993b0fc2a70fb4aa94bf0 (diff) |
Create all the right modes for 16-bit screens.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/mga/mga_xmesa.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index fa981198fec..4c5babf7bf5 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -127,7 +127,7 @@ static __GLcontextModes * fill_in_modes( __GLcontextModes * modes, modes->accumRedBits = 16 * j; modes->accumGreenBits = 16 * j; modes->accumBlueBits = 16 * j; - modes->accumAlphaBits = 0; + modes->accumAlphaBits = (masks[index][3] != 0) ? 16 * j : 0; modes->visualRating = (j == 0) ? GLX_NONE : GLX_SLOW_CONFIG; modes->stencilBits = stencil_bits; @@ -174,13 +174,18 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits, GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML }; - int depth_buffer_modes[2][2] = { - { 0, 0 }, - { 0, 0 } - }; + int depth_buffer_modes[2][2]; + + depth_buffer_modes[0][0] = depth_bits; depth_buffer_modes[1][0] = depth_bits; - depth_buffer_modes[1][1] = stencil_bits; + + /* Just like with the accumulation buffer, always provide some modes + * with a stencil buffer. It will be a sw fallback, but some apps won't + * care about that. + */ + depth_buffer_modes[0][1] = 0; + depth_buffer_modes[1][1] = (stencil_bits == 0) ? 8 : stencil_bits; depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; back_buffer_factor = (have_back_buffer) ? 2 : 1; @@ -203,6 +208,14 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits, GLX_DIRECT_COLOR ); } + /* Mark the visual as slow if there are "fake" stencil bits. + */ + for ( m = modes ; m != NULL ; m = m->next ) { + if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) { + m->visualRating = GLX_SLOW_CONFIG; + } + } + return modes; } #endif /* USE_NEW_INTERFACE */ |