summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2004-02-26 00:33:22 +0000
committerIan Romanick <[email protected]>2004-02-26 00:33:22 +0000
commit795f1faf81b988ac969356945e25dc712bcc6a94 (patch)
tree3d7c44aff8d25ec25a62aac1c3a791313f41ad7b /src/mesa/drivers/dri
parent04bcaac383cb6d3d5bceb7ecf65ff97c10aa7111 (diff)
Create all the right modes for 16-bit screens.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/r200/r200_screen.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c
index 1e1d679a578..45d7c1699e0 100644
--- a/src/mesa/drivers/dri/r200/r200_screen.c
+++ b/src/mesa/drivers/dri/r200/r200_screen.c
@@ -151,7 +151,7 @@ static __GLcontextModes * fill_in_modes( __GLcontextModes * modes,
modes->accumRedBits = 16 * j;
modes->accumGreenBits = 16 * j;
modes->accumBlueBits = 16 * j;
- modes->accumAlphaBits = 16 * j;
+ modes->accumAlphaBits = (masks[index][3] != 0) ? 16 * j : 0;
modes->visualRating = (j == 0) ? GLX_NONE : GLX_SLOW_CONFIG;
modes->stencilBits = stencil_bits;
@@ -207,7 +207,12 @@ r200FillInModes( unsigned pixel_bits, unsigned depth_bits,
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[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;
@@ -230,6 +235,14 @@ r200FillInModes( 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 != stencil_bits ) {
+ m->visualRating = GLX_SLOW_CONFIG;
+ }
+ }
+
return modes;
}
#endif /* USE_NEW_INTERFACE */