summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/savage/savagespan.c
diff options
context:
space:
mode:
authorXiang, Haihao <[email protected]>2008-08-05 11:28:54 +0800
committerXiang, Haihao <[email protected]>2008-08-05 11:34:26 +0800
commit8e8019b49ab137403ba92aef3e286f4e27049ad5 (patch)
tree2bd99df8f04c891a4da08c8fd971fb95598eae51 /src/mesa/drivers/dri/savage/savagespan.c
parenta3024caff1c790cf9f24476926aa62198f1e7b53 (diff)
dri: Fix write/read depth buffer issue under 16bpp mode. See bug #16646
Diffstat (limited to 'src/mesa/drivers/dri/savage/savagespan.c')
-rw-r--r--src/mesa/drivers/dri/savage/savagespan.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c
index 61ab9e6d64a..00fd1259fd6 100644
--- a/src/mesa/drivers/dri/savage/savagespan.c
+++ b/src/mesa/drivers/dri/savage/savagespan.c
@@ -93,6 +93,8 @@
/* 16 bit integer depthbuffer functions
* Depth range is reversed. See also savageCalcViewport.
*/
+#define VALUE_TYPE GLushort
+
#define WRITE_DEPTH( _x, _y, d ) \
*(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = 0xFFFF - d
@@ -107,6 +109,8 @@
/* 16 bit float depthbuffer functions
*/
+#define VALUE_TYPE GLushort
+
#define WRITE_DEPTH( _x, _y, d ) \
*(GLushort *)(buf + ((_x)<<1) + (_y)*pitch) = \
savageEncodeFloat16( 1.0 - (GLfloat)d/65535.0 )
@@ -125,6 +129,8 @@
/* 8-bit stencil /24-bit integer depth depthbuffer functions.
* Depth range is reversed. See also savageCalcViewport.
*/
+#define VALUE_TYPE GLuint
+
#define WRITE_DEPTH( _x, _y, d ) do { \
GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch); \
tmp &= 0xFF000000; \
@@ -143,6 +149,8 @@
/* 24 bit float depthbuffer functions
*/
+#define VALUE_TYPE GLuint
+
#define WRITE_DEPTH( _x, _y, d ) do { \
GLuint tmp = *(GLuint *)(buf + ((_x)<<2) + (_y)*pitch); \
tmp &= 0xFF000000; \