summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-10-05 17:38:03 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-10-05 17:38:03 +0000
commit7a13c836633485acb1cdf38e297eb85052071f55 (patch)
tree10347d8193a37d1058ab4ba74b7b2ec4234013b0
parentd4e84664a50064ebc67e5b4c76190d74e61c4bf3 (diff)
better handling of GLX_DEPTH_SIZE in glXChooseVisual()
-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 c1f8582ad70..fca66189154 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -1,4 +1,4 @@
-/* $Id: fakeglx.c,v 1.34.4.2 2000/08/08 16:19:32 brianp Exp $ */
+/* $Id: fakeglx.c,v 1.34.4.3 2000/10/05 17:38:03 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;