fmesa->ffbScreen->rp_active = 1; \
} while(0)
-#define Y_FLIP(__y) (height - __y)
+#define Y_FLIP(__y) (height - __y - 1)
#define READ_RGBA(rgba,__x,__y) \
do { GLuint p = *(GLuint *)(buf + ((__x)<<2) + ((__y)<<13)); \
assert(vis->redBits == 8);
assert(vis->greenBits == 8);
assert(vis->blueBits == 8);
- drb->Base.GetRow = ffbReadRGBASpan_888;
- drb->Base.GetValues = ffbReadRGBAPixels_888;
- drb->Base.PutRow = ffbWriteRGBASpan_888;
- drb->Base.PutRowRGB = ffbWriteRGBSpan_888;
- drb->Base.PutMonoRow = ffbWriteMonoRGBASpan_888;
- drb->Base.PutValues = ffbWriteRGBAPixels_888;
- drb->Base.PutMonoValues = ffbWriteMonoRGBAPixels_888;
+ ffbInitPointers_888(&drb->Base);
}
char *buf = (char *)(drb->flippedData + \
dPriv->x * 2 + \
dPriv->y * pitch); \
- char *read_buf = buf; \
- (void) read_buf; (void) buf; (void) p
+ (void) buf; (void) p
#define LOCAL_DEPTH_VARS \
i810ContextPtr imesa = I810_CONTEXT(ctx); \
#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) * 255 / 0xf8; \
rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \
rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \
{
if (drb->Base.InternalFormat == GL_RGBA) {
/* always 565 RGB */
- drb->Base.GetRow = i810ReadRGBASpan_565;
- drb->Base.GetValues = i810ReadRGBAPixels_565;
- drb->Base.PutRow = i810WriteRGBASpan_565;
- drb->Base.PutRowRGB = i810WriteRGBSpan_565;
- drb->Base.PutMonoRow = i810WriteMonoRGBASpan_565;
- drb->Base.PutValues = i810WriteRGBAPixels_565;
- drb->Base.PutMonoValues = i810WriteMonoRGBAPixels_565;
+ i810InitPointers_565(&drb->Base);
}
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
i810InitDepthPointers_z16(&drb->Base);
{
if (drb->Base.InternalFormat == GL_RGBA) {
if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) {
- drb->Base.GetRow = i830ReadRGBASpan_555;
- drb->Base.GetValues = i830ReadRGBAPixels_555;
- drb->Base.PutRow = i830WriteRGBASpan_555;
- drb->Base.PutRowRGB = i830WriteRGBSpan_555;
- drb->Base.PutMonoRow = i830WriteMonoRGBASpan_555;
- drb->Base.PutValues = i830WriteRGBAPixels_555;
- drb->Base.PutMonoValues = i830WriteMonoRGBAPixels_555;
+ i830InitPointers_555(&drb->Base);
}
else if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = i830ReadRGBASpan_565;
- drb->Base.GetValues = i830ReadRGBAPixels_565;
- drb->Base.PutRow = i830WriteRGBASpan_565;
- drb->Base.PutRowRGB = i830WriteRGBSpan_565;
- drb->Base.PutMonoRow = i830WriteMonoRGBASpan_565;
- drb->Base.PutValues = i830WriteRGBAPixels_565;
- drb->Base.PutMonoValues = i830WriteMonoRGBAPixels_565;
+ i830InitPointers_565(&drb->Base);
}
else {
assert(vis->redBits == 8);
assert(vis->greenBits == 8);
assert(vis->blueBits == 8);
- drb->Base.GetRow = i830ReadRGBASpan_8888;
- drb->Base.GetValues = i830ReadRGBAPixels_8888;
- drb->Base.PutRow = i830WriteRGBASpan_8888;
- drb->Base.PutRowRGB = i830WriteRGBSpan_8888;
- drb->Base.PutMonoRow = i830WriteMonoRGBASpan_8888;
- drb->Base.PutValues = i830WriteRGBAPixels_8888;
- drb->Base.PutMonoValues = i830WriteMonoRGBAPixels_8888;
+ i830InitPointers_8888(&drb->Base);
}
}
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
char *buf = (char *) drb->Base.Data + \
dPriv->x * drb->cpp + \
dPriv->y * pitch; \
- char *read_buf = buf; \
GLushort p; \
- (void) read_buf; (void) buf; (void) p
+ (void) buf; (void) p
#define LOCAL_DEPTH_VARS \
intelContextPtr intel = INTEL_CONTEXT(ctx); \
#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 >> 11) & 0x1f) * 255) / 31; \
rgba[1] = (((p >> 5) & 0x3f) * 255) / 63; \
rgba[2] = (((p >> 0) & 0x1f) * 255) / 31; \
#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 >> 7) & 0xf8; \
rgba[1] = (p >> 3) & 0xf8; \
rgba[2] = (p << 3) & 0xf8; \
char *buf = (char *)drb->Base.Data + \
dPriv->x * drb->cpp + \
dPriv->y * pitch; \
- char *read_buf = buf; \
GLuint p; \
- (void) read_buf; (void) buf; (void) p
+ (void) buf; (void) p
#undef INIT_MONO_PIXEL
#define INIT_MONO_PIXEL(p,color)\
#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; \
{
if (drb->Base.InternalFormat == GL_RGBA) {
if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) {
- drb->Base.GetRow = intelReadRGBASpan_555;
- drb->Base.GetValues = intelReadRGBAPixels_555;
- drb->Base.PutRow = intelWriteRGBASpan_555;
- drb->Base.PutRowRGB = intelWriteRGBSpan_555;
- drb->Base.PutMonoRow = intelWriteMonoRGBASpan_555;
- drb->Base.PutValues = intelWriteRGBAPixels_555;
- drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_555;
+ intelInitPointers_555(&drb->Base);
}
else if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = intelReadRGBASpan_565;
- drb->Base.GetValues = intelReadRGBAPixels_565;
- drb->Base.PutRow = intelWriteRGBASpan_565;
- drb->Base.PutRowRGB = intelWriteRGBSpan_565;
- drb->Base.PutMonoRow = intelWriteMonoRGBASpan_565;
- drb->Base.PutValues = intelWriteRGBAPixels_565;
- drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_565;
+ intelInitPointers_565(&drb->Base);
}
else {
assert(vis->redBits == 8);
assert(vis->greenBits == 8);
assert(vis->blueBits == 8);
- drb->Base.GetRow = intelReadRGBASpan_8888;
- drb->Base.GetValues = intelReadRGBAPixels_8888;
- drb->Base.PutRow = intelWriteRGBASpan_8888;
- drb->Base.PutRowRGB = intelWriteRGBSpan_8888;
- drb->Base.PutMonoRow = intelWriteMonoRGBASpan_8888;
- drb->Base.PutValues = intelWriteRGBAPixels_8888;
- drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_8888;
+ intelInitPointers_8888(&drb->Base);
}
}
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
int p;
driRenderbuffer *drb =
(driRenderbuffer *) ctx->WinSysDrawBuffer->_ColorDrawBuffers[0][0];
- volatile int *read_buf =
+ volatile int *buf =
(volatile int *)(radeon->dri.screen->pFB + drb->offset);
- p = *read_buf;
- *read_buf = p;
+ p = *buf;
+ *buf = p;
}
}
static void radeonSpanRenderFinish(GLcontext * ctx)
{
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-
_swrast_flush(ctx);
UNLOCK_HARDWARE(radeon);
}
{
if (drb->Base.InternalFormat == GL_RGBA) {
if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = radeonReadRGBASpan_RGB565;
- drb->Base.GetValues = radeonReadRGBAPixels_RGB565;
- drb->Base.PutRow = radeonWriteRGBASpan_RGB565;
- drb->Base.PutRowRGB = radeonWriteRGBSpan_RGB565;
- drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_RGB565;
- drb->Base.PutValues = radeonWriteRGBAPixels_RGB565;
- drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_RGB565;
+ radeonInitPointers_RGB565(&drb->Base);
}
else {
- drb->Base.GetRow = radeonReadRGBASpan_ARGB8888;
- drb->Base.GetValues = radeonReadRGBAPixels_ARGB8888;
- drb->Base.PutRow = radeonWriteRGBASpan_ARGB8888;
- drb->Base.PutRowRGB = radeonWriteRGBSpan_ARGB8888;
- drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_ARGB8888;
- drb->Base.PutValues = radeonWriteRGBAPixels_ARGB8888;
- drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_ARGB8888;
+ radeonInitPointers_ARGB8888(&drb->Base);
}
}
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
GLuint height = dPriv->h; \
char *buf = (char *)(sPriv->pFB + drb->offset \
+ (drb->backBuffer ? 0 : dPriv->x * cpp + dPriv->y * pitch));\
- char *read_buf = buf; \
GLuint p; \
- (void) read_buf; (void) buf; (void) p; (void) pitch
+ (void) p
/* FIXME! Depth/Stencil read/writes don't work ! */
#define LOCAL_DEPTH_VARS \
#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 >> 7) & 0xf8; \
rgba[1] = (p >> 2) & 0xf8; \
rgba[2] = (p << 3) & 0xf8; \
#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; \
{
if (drb->Base.InternalFormat == GL_RGBA) {
if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = s3vReadRGBASpan_RGB555;
- drb->Base.GetValues = s3vReadRGBAPixels_RGB555;
- drb->Base.PutRow = s3vWriteRGBASpan_RGB555;
- drb->Base.PutRowRGB = s3vWriteRGBSpan_RGB555;
- drb->Base.PutMonoRow = s3vWriteMonoRGBASpan_RGB555;
- drb->Base.PutValues = s3vWriteRGBAPixels_RGB555;
- drb->Base.PutMonoValues = s3vWriteMonoRGBAPixels_RGB555;
+ s3vInitPointers_RGB555(&drb->Base);
}
else {
- drb->Base.GetRow = s3vReadRGBASpan_ARGB8888;
- drb->Base.GetValues = s3vReadRGBAPixels_ARGB8888;
- drb->Base.PutRow = s3vWriteRGBASpan_ARGB8888;
- drb->Base.PutRowRGB = s3vWriteRGBSpan_ARGB8888;
- drb->Base.PutMonoRow = s3vWriteMonoRGBASpan_ARGB8888;
- drb->Base.PutValues = s3vWriteRGBAPixels_ARGB8888;
- drb->Base.PutMonoValues = s3vWriteMonoRGBAPixels_ARGB8888;
+ s3vInitPointers_ARGB8888(&drb->Base);
}
}
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
{
if (drb->Base.InternalFormat == GL_RGBA) {
if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- drb->Base.GetRow = tdfxReadRGBASpan_RGB565;
- drb->Base.GetValues = tdfxReadRGBAPixels_RGB565;
- drb->Base.PutRow = tdfxWriteRGBASpan_RGB565;
- drb->Base.PutRowRGB = tdfxWriteRGBSpan_RGB565;
- drb->Base.PutMonoRow = tdfxWriteMonoRGBASpan_RGB565;
- drb->Base.PutValues = tdfxWriteRGBAPixels_RGB565;
- drb->Base.PutMonoValues = tdfxWriteMonoRGBAPixels_RGB565;
+ tdfxInitPointers_RGB565(&drb->Base);
}
else if (vis->redBits == 8 && vis->greenBits == 8
&& vis->blueBits == 8 && vis->alphaBits == 0) {
- drb->Base.GetRow = tdfxReadRGBASpan_RGB888;
- drb->Base.GetValues = tdfxReadRGBAPixels_RGB888;
- drb->Base.PutRow = tdfxWriteRGBASpan_RGB888;
- drb->Base.PutRowRGB = tdfxWriteRGBSpan_RGB888;
- drb->Base.PutMonoRow = tdfxWriteMonoRGBASpan_RGB888;
- drb->Base.PutValues = tdfxWriteRGBAPixels_RGB888;
- drb->Base.PutMonoValues = tdfxWriteMonoRGBAPixels_RGB888;
+ tdfxInitPointers_RGB888(&drb->Base);
}
else if (vis->redBits == 8 && vis->greenBits == 8
&& vis->blueBits == 8 && vis->alphaBits == 8) {
- drb->Base.GetRow = tdfxReadRGBASpan_ARGB8888;
- drb->Base.GetValues = tdfxReadRGBAPixels_ARGB8888;
- drb->Base.PutRow = tdfxWriteRGBASpan_ARGB8888;
- drb->Base.PutRowRGB = tdfxWriteRGBSpan_ARGB8888;
- drb->Base.PutMonoRow = tdfxWriteMonoRGBASpan_ARGB8888;
- drb->Base.PutValues = tdfxWriteRGBAPixels_ARGB8888;
- drb->Base.PutMonoValues = tdfxWriteMonoRGBAPixels_ARGB8888;
+ tdfxInitPointers_ARGB8888(&drb->Base);
}
else {
_mesa_problem(NULL, "problem in tdfxSetSpanFunctions");