summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-10-05 17:38:21 +0000
committerBrian Paul <[email protected]>2000-10-05 17:38:21 +0000
commit2c7e6334ec81c2fab2cce9e0fe52cd30256e37ea (patch)
tree9c07411ee7553b5e20f527180c266a074bba987b /src/mesa/drivers
parentfa849a0e1622039bf66ef2b7506669aba8d77d91 (diff)
better handling of GLX_DEPTH_SIZE in glXChooseVisual()
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/x11/fakeglx.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 73f1de374ec..cca2fb84a73 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -1,4 +1,4 @@
-/* $Id: fakeglx.c,v 1.37 2000/09/26 21:28:39 brianp Exp $ */
+/* $Id: fakeglx.c,v 1.38 2000/10/05 17:38:21 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1050,15 +1050,16 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list )
if (vis) {
/* Note: we're not exactly obeying the glXChooseVisual rules here.
* When GLX_DEPTH_SIZE = 1 is specified we're supposed to choose the
- * largest depth buffer size, which is 32bits/value. However, we
+ * largest depth buffer size, which is 32bits/value. Instead, we
* return 16 to maintain performance with earlier versions of Mesa.
*/
- if (depth_size == 1)
- depth_size = DEFAULT_SOFTWARE_DEPTH_BITS;
- else if (depth_size > 24)
- depth_size = 31;
+ if (depth_size > 24)
+ depth_size = 31; /* 32 causes int overflow problems */
else if (depth_size > 16)
depth_size = 24;
+ else if (depth_size > 0)
+ depth_size = DEFAULT_SOFTWARE_DEPTH_BITS; /*16*/
+
/* we only support one size of stencil and accum buffers. */
if (stencil_size > 0)
stencil_size = STENCIL_BITS;