summaryrefslogtreecommitdiff
path: root/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/mga/mgaspan.c')
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaspan.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
index b707bc406..83a78f2dc 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaspan.c
@@ -25,7 +25,6 @@
dPriv->y * pitch); \
GLuint p = MGA_CONTEXT( ctx )->MonoColor; \
(void) read_buf; (void) buf; (void) p
-
#define LOCAL_DEPTH_VARS \
@@ -59,8 +58,10 @@
#define HW_LOCK() \
mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
+ FLUSH_BATCH(mmesa); \
LOCK_HARDWARE_QUIESCENT(mmesa);
+
#define HW_CLIPLOOP() \
do { \
int _nc = mmesa->numClipRects; \
@@ -97,9 +98,9 @@
#define READ_RGBA( rgba, _x, _y ) \
do { \
GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \
- rgba[0] = (p >> 8) & 0xf8; \
- rgba[1] = (p >> 3) & 0xfc; \
- rgba[2] = (p << 3) & 0xf8; \
+ rgba[0] = (((p >> 11) & 0x1f) * 255) / 31; \
+ rgba[1] = (((p >> 5) & 0x3f) * 255) / 63; \
+ rgba[2] = (((p >> 0) & 0x1f) * 255) / 31; \
rgba[3] = 255; \
} while(0)
@@ -127,7 +128,7 @@ do { \
rgba[0] = (p >> 16) & 0xff; \
rgba[1] = (p >> 8) & 0xff; \
rgba[2] = (p >> 0) & 0xff; \
- rgba[3] = (p >> 24) & 0xff; \
+ rgba[3] = 0xff; \
} while (0)
#define TAG(x) mga##x##_8888
@@ -168,13 +169,13 @@ do { \
#define WRITE_DEPTH( _x, _y, d ) { \
GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \
tmp &= 0xff; \
- tmp |= (d) & 0xffffff00; \
+ tmp |= (d) << 8; \
*(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \
}
-#define READ_DEPTH( d, _x, _y ) \
- d = *(GLuint *)(buf + _x*4 + _y*pitch) & ~0xff;
-
+#define READ_DEPTH( d, _x, _y ) { \
+ d = (*(GLuint *)(buf + _x*4 + _y*pitch) & ~0xff) >> 8; \
+}
#define TAG(x) mga##x##_24_8
#include "depthtmp.h"