summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/tdfx/tdfx_span.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2006-11-14 00:10:34 +0000
committerIan Romanick <idr@us.ibm.com>2006-11-14 00:10:34 +0000
commitefa91b9a8f39dd49a59e4fc5524657f7cd5ae8ac (patch)
tree16f3a5afa3d2763ea7b29b26f9af24c1c78f5b78 /src/mesa/drivers/dri/tdfx/tdfx_span.c
parent0b69e4837ebf795ba0dbd56d610fc3bd94363f34 (diff)
Enable GLX_SGI_make_current_read for tdfx.
Implement GLX_SGI_make_current_read for tdfx. Remove annoying debug printf in tdfxSwapBuffers. Updated a comment in drirenderbuffer.h to note that the tdfx driver uses a flag that was previously only used by s3v. This code was tested with glxgears, wincopy, and manywin.
Diffstat (limited to 'src/mesa/drivers/dri/tdfx/tdfx_span.c')
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_span.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c
index ee5eb459be..d9d52d2b6f 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_span.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c
@@ -47,21 +47,19 @@
#define LOCAL_VARS \
- __DRIdrawablePrivate *dPriv = fxMesa->driDrawable; \
- tdfxScreenPrivate *fxPriv = fxMesa->fxScreen; \
- GLboolean isFront = (ctx->DrawBuffer->_ColorDrawBufferMask[0] \
- == BUFFER_BIT_FRONT_LEFT); \
- GLuint pitch = isFront ? (fxMesa->screen_width * BYTESPERPIXEL) \
- : info.strideInBytes; \
- GLuint height = fxMesa->height; \
+ driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ __DRIdrawablePrivate *const dPriv = drb->dPriv; \
+ GLuint pitch = drb->backBuffer ? info.strideInBytes \
+ : (drb->pitch * drb->cpp); \
+ const GLuint bottom = dPriv->h - 1; \
char *buf = (char *)((char *)info.lfbPtr + \
- dPriv->x * fxPriv->cpp + \
- dPriv->y * pitch); \
+ (dPriv->x * drb->cpp) + \
+ (dPriv->y * pitch)); \
GLuint p; \
(void) buf; (void) p;
-#define Y_FLIP(_y) (height - _y - 1)
+#define Y_FLIP(_y) (bottom - _y)
#define HW_WRITE_LOCK() \
@@ -71,10 +69,9 @@
UNLOCK_HARDWARE( fxMesa ); \
LOCK_HARDWARE( fxMesa ); \
info.size = sizeof(GrLfbInfo_t); \
- if ( fxMesa->Glide.grLfbLock( GR_LFB_WRITE_ONLY, \
- fxMesa->DrawBuffer, LFB_MODE, \
- GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) \
- {
+ if (fxMesa->Glide.grLfbLock(GR_LFB_WRITE_ONLY, fxMesa->DrawBuffer, \
+ LFB_MODE, GR_ORIGIN_UPPER_LEFT, FXFALSE, \
+ &info)) {
#define HW_WRITE_UNLOCK() \
fxMesa->Glide.grLfbUnlock( GR_LFB_WRITE_ONLY, fxMesa->DrawBuffer );\