summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/x11
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-02-18 14:49:27 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-02-18 14:49:27 +0000
commitf448e632b60c3bb81cc3a01d92430f5e4a110327 (patch)
treec9b5367f71efa15ece1964773d49f5fce0506b57 /src/mesa/drivers/x11
parent49f7430b12eec93287af96058026ede1649ba007 (diff)
XMesaGetDepthBuffer() returned wrong bytesPerValue (Karl Schultz)
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r--src/mesa/drivers/x11/xm_api.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 2e87ca928a..6df7d9a786 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.3
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -2508,7 +2508,8 @@ GLboolean XMesaGetDepthBuffer( XMesaBuffer b, GLint *width, GLint *height,
else {
*width = b->mesa_buffer.Width;
*height = b->mesa_buffer.Height;
- *bytesPerValue = sizeof(GLdepth);
+ *bytesPerValue = b->mesa_buffer.Visual.depthBits <= 16
+ ? sizeof(GLushort) : sizeof(GLuint);
*buffer = b->mesa_buffer.DepthBuffer;
return GL_TRUE;
}