summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/src/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/extras/Mesa/src/context.c')
-rw-r--r--xc/extras/Mesa/src/context.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/xc/extras/Mesa/src/context.c b/xc/extras/Mesa/src/context.c
index 67ca90e3c..04c3e1c05 100644
--- a/xc/extras/Mesa/src/context.c
+++ b/xc/extras/Mesa/src/context.c
@@ -338,10 +338,18 @@ _mesa_create_visual( GLboolean rgbFlag,
vis->DepthMax = 1;
vis->DepthMaxF = 1.0F;
}
- else {
+ else if (depthBits < 32) {
vis->DepthMax = (1 << depthBits) - 1;
vis->DepthMaxF = (GLfloat) vis->DepthMax;
}
+ else {
+ /* Special case since shift values greater than or equal to the
+ * number of bits in the left hand expression's type are
+ * undefined.
+ */
+ vis->DepthMax = 0xffffffff;
+ vis->DepthMaxF = (GLfloat) vis->DepthMax;
+ }
return vis;
}