diff options
author | Brian Paul <[email protected]> | 2005-09-04 15:02:48 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-09-04 15:02:48 +0000 |
commit | 0cfd4f92dde078bcc9f458ede91cc341a7b0ef5b (patch) | |
tree | 54386872a8299f33717e81285e1ad2e50ca74435 /src/mesa/drivers | |
parent | eae73dbd916d3109224fdb938120acd1abb6b646 (diff) |
replace GET_SRC_PTR, GET_DST_PTR with GET_PTR
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/gamma/gamma_span.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/mach64/mach64_span.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_span.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_span.c | 17 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_span.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_span.c | 6 |
6 files changed, 24 insertions, 42 deletions
diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c index 66cc961c64f..f62bea9b66d 100644 --- a/src/mesa/drivers/dri/gamma/gamma_span.c +++ b/src/mesa/drivers/dri/gamma/gamma_span.c @@ -19,12 +19,8 @@ gmesa->drawOffset + \ (dPriv->x * gammascrn->cpp) + \ (dPriv->y * pitch)); \ - char *read_buf = (char *)(sPriv->pFB + \ - gmesa->readOffset + \ - (dPriv->x * gammascrn->cpp) + \ - (dPriv->y * pitch)); \ GLuint p; \ - (void) read_buf; (void) buf; (void) p + (void) buf; (void) p /* FIXME! Depth/Stencil read/writes don't work ! */ #define LOCAL_DEPTH_VARS \ @@ -71,7 +67,7 @@ #define READ_RGBA( rgba, _x, _y ) \ do { \ - GLushort p = *(GLushort *)(read_buf + _x*2 + _y*pitch); \ + GLushort p = *(GLushort *)(buf + _x*2 + _y*pitch); \ rgba[0] = (p >> 8) & 0xf8; \ rgba[1] = (p >> 3) & 0xfc; \ rgba[2] = (p << 3) & 0xf8; \ @@ -103,7 +99,7 @@ #define READ_RGBA( rgba, _x, _y ) \ do { \ - GLuint p = *(GLuint *)(read_buf + _x*4 + _y*pitch); \ + GLuint p = *(GLuint *)(buf + _x*4 + _y*pitch); \ rgba[0] = (p >> 16) & 0xff; \ rgba[1] = (p >> 8) & 0xff; \ rgba[2] = (p >> 0) & 0xff; \ diff --git a/src/mesa/drivers/dri/mach64/mach64_span.c b/src/mesa/drivers/dri/mach64/mach64_span.c index dc9f27caeec..3830a28165b 100644 --- a/src/mesa/drivers/dri/mach64/mach64_span.c +++ b/src/mesa/drivers/dri/mach64/mach64_span.c @@ -38,9 +38,6 @@ #define DBG 0 -#define GET_PTR(X,Y) (sPriv->pFB + drb->offset \ - + ((dPriv->y + (Y)) * drb->pitch + (dPriv->x + (X))) * drb->cpp) - #define LOCAL_VARS \ mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); \ __DRIscreenPrivate *sPriv = mmesa->driScreen; \ @@ -95,8 +92,8 @@ #define TAG(x) mach64##x##_RGB565 #define TAG2(x,y) mach64##x##_RGB565##y -#define GET_SRC_PTR(X,Y) GET_PTR(X,Y) -#define GET_DST_PTR(X,Y) GET_SRC_PTR(X,Y) +#define GET_PTR(X,Y) (sPriv->pFB + drb->offset \ + + ((dPriv->y + (Y)) * drb->pitch + (dPriv->x + (X))) * drb->cpp) #include "spantmp2.h" @@ -109,8 +106,8 @@ #define TAG(x) mach64##x##_ARGB8888 #define TAG2(x,y) mach64##x##_ARGB8888##y -#define GET_SRC_PTR(X,Y) GET_PTR(X,Y) -#define GET_DST_PTR(X,Y) GET_SRC_PTR(X,Y) +#define GET_PTR(X,Y) (sPriv->pFB + drb->offset \ + + ((dPriv->y + (Y)) * drb->pitch + (dPriv->x + (X))) * drb->cpp) #include "spantmp2.h" diff --git a/src/mesa/drivers/dri/r128/r128_span.c b/src/mesa/drivers/dri/r128/r128_span.c index e64282b8a75..d204f4de92c 100644 --- a/src/mesa/drivers/dri/r128/r128_span.c +++ b/src/mesa/drivers/dri/r128/r128_span.c @@ -44,9 +44,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define DBG 0 -#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \ - + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp) - #define HAVE_HW_DEPTH_SPANS 1 #define HAVE_HW_DEPTH_PIXELS 1 @@ -88,8 +85,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define TAG(x) r128##x##_RGB565 #define TAG2(x,y) r128##x##_RGB565##y -#define GET_SRC_PTR(X,Y) GET_PTR(X,Y) -#define GET_DST_PTR(X,Y) GET_PTR(X,Y) +#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \ + + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp) #include "spantmp2.h" @@ -100,8 +97,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define TAG(x) r128##x##_ARGB8888 #define TAG2(x,y) r128##x##_ARGB8888##y -#define GET_SRC_PTR(X,Y) GET_PTR(X,Y) -#define GET_DST_PTR(X,Y) GET_PTR(X,Y) +#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \ + + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp) #include "spantmp2.h" diff --git a/src/mesa/drivers/dri/r200/r200_span.c b/src/mesa/drivers/dri/r200/r200_span.c index 8de41332e4b..7cfed947716 100644 --- a/src/mesa/drivers/dri/r200/r200_span.c +++ b/src/mesa/drivers/dri/r200/r200_span.c @@ -46,9 +46,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define DBG 0 -#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \ - + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp) - #define LOCAL_VARS \ r200ContextPtr rmesa = R200_CONTEXT(ctx); \ __DRIscreenPrivate *sPriv = rmesa->dri.screen; \ @@ -89,8 +86,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define TAG(x) r200##x##_RGB565 #define TAG2(x,y) r200##x##_RGB565##y -#define GET_SRC_PTR(X,Y) GET_PTR(X,Y) -#define GET_DST_PTR(X,Y) GET_PTR(X,Y) +#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \ + + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp) #include "spantmp2.h" /* 32 bit, ARGB8888 color spanline and pixel functions @@ -100,8 +97,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define TAG(x) r200##x##_ARGB8888 #define TAG2(x,y) r200##x##_ARGB8888##y -#define GET_SRC_PTR(X,Y) GET_PTR(X,Y) -#define GET_DST_PTR(X,Y) GET_PTR(X,Y) +#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \ + + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp) #include "spantmp2.h" @@ -259,10 +256,10 @@ static void r200SpanRenderStart( GLcontext *ctx ) int p; driRenderbuffer *drb = (driRenderbuffer *) ctx->WinSysDrawBuffer->_ColorDrawBuffers[0][0]; - volatile int *read_buf = + volatile int *buf = (volatile int *)(rmesa->dri.screen->pFB + drb->offset); - p = *read_buf; - *read_buf = p; + p = *buf; + *buf = p; } } diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 5167bdd426b..05c47819368 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -50,8 +50,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define DBG 0 -#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \ - + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp) /* * Eventually, try to remove all references to ctx/rmesa here. @@ -100,8 +98,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define TAG(x) radeon##x##_RGB565 #define TAG2(x,y) radeon##x##_RGB565##y -#define GET_SRC_PTR(X,Y) GET_PTR(X, Y) -#define GET_DST_PTR(X,Y) GET_PTR(X, Y) +#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \ + + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp) #include "spantmp2.h" @@ -112,8 +110,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define TAG(x) radeon##x##_ARGB8888 #define TAG2(x,y) radeon##x##_ARGB8888##y -#define GET_SRC_PTR(X,Y) GET_PTR(X, Y) -#define GET_DST_PTR(X,Y) GET_PTR(X, Y) +#define GET_PTR(X,Y) (sPriv->pFB + drb->flippedOffset \ + + ((dPriv->y + (Y)) * drb->flippedPitch + (dPriv->x + (X))) * drb->cpp) #include "spantmp2.h" @@ -251,7 +249,6 @@ do { \ static void radeonSpanRenderStart( GLcontext *ctx ) { radeonContextPtr rmesa = RADEON_CONTEXT( ctx ); - RADEON_FIREVERTICES( rmesa ); LOCK_HARDWARE( rmesa ); radeonWaitForIdleLocked( rmesa ); diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c index 5bffade9408..112b902bd29 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.c +++ b/src/mesa/drivers/dri/unichrome/via_span.c @@ -56,8 +56,7 @@ /* 16 bit, RGB565 color spanline and pixel functions */ -#define GET_SRC_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch) -#define GET_DST_PTR(_x, _y) GET_SRC_PTR(_x, _y); +#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch) #define SPANTMP_PIXEL_FMT GL_RGB #define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5 @@ -68,8 +67,7 @@ /* 32 bit, ARGB8888 color spanline and pixel functions */ -#define GET_SRC_PTR(_x, _y) (buf + (_x) * 4 + (_y) * pitch) -#define GET_DST_PTR(_x, _y) GET_SRC_PTR(_x, _y); +#define GET_PTR(_x, _y) (buf + (_x) * 4 + (_y) * pitch) #define SPANTMP_PIXEL_FMT GL_BGRA #define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV |