summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolai Haehnle <[email protected]>2005-05-14 11:43:04 +0000
committerNicolai Haehnle <[email protected]>2005-05-14 11:43:04 +0000
commit11bd5c1ac41b08c35c773264fc85c69ec8411b5b (patch)
tree1b67f707a21440ac1317f0b1f2b7bc6e969d1099 /src
parent686e9b9f571cc9b6f2acd09be309af26f43890a3 (diff)
Fix span functions for stencil buffer access.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/radeon_span.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_span.c b/src/mesa/drivers/dri/r300/radeon_span.c
index 53a32106790..0ab6b9b7e0c 100644
--- a/src/mesa/drivers/dri/r300/radeon_span.c
+++ b/src/mesa/drivers/dri/r300/radeon_span.c
@@ -286,8 +286,8 @@ do { \
do { \
GLuint offset = radeon_mba_z32( radeon, _x + xo, _y + yo ); \
GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0x00ffffff; \
- tmp |= (((d) & 0xff) << 24); \
+ tmp &= 0xffffff00; \
+ tmp |= (d) & 0xff; \
*(GLuint *)(buf + offset) = tmp; \
} while (0)
@@ -295,8 +295,7 @@ do { \
do { \
GLuint offset = radeon_mba_z32( radeon, _x + xo, _y + yo ); \
GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0xff000000; \
- d = tmp >> 24; \
+ d = tmp & 0x000000ff; \
} while (0)
#define TAG(x) radeon##x##_24_8_TILE
@@ -306,19 +305,18 @@ do { \
*/
#define WRITE_STENCIL( _x, _y, d ) \
do { \
- GLuint offset = (_x + xo)*4 + (_y + yo)*pitch; \
+ GLuint offset = (_x + xo + (_y + yo)*pitch)*4; \
GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0x00ffffff; \
- tmp |= (((d) & 0xff) << 24); \
+ tmp &= 0xffffff00; \
+ tmp |= (d) & 0xff; \
*(GLuint *)(buf + offset) = tmp; \
} while (0)
#define READ_STENCIL( d, _x, _y ) \
do { \
- GLuint offset = (_x + xo)*4 + (_y + yo)*pitch; \
+ GLuint offset = (_x + xo + (_y + yo)*pitch)*4; \
GLuint tmp = *(GLuint *)(buf + offset); \
- tmp &= 0xff000000; \
- d = tmp >> 24; \
+ d = tmp & 0x000000ff; \
} while (0)
#define TAG(x) radeon##x##_24_8_LINEAR