radeon: fix pixel readback for RGB8 tests

This commit is contained in:
Dave Airlie 2009-03-31 14:43:14 +10:00
parent 5ad32cfd21
commit 2f3be8ab14
3 changed files with 22 additions and 2 deletions

View file

@ -274,6 +274,15 @@ radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv)
rrb->base.BlueBits = 5;
rrb->base.DataType = GL_UNSIGNED_BYTE;
break;
case GL_RGB8:
rrb->base._ActualFormat = GL_RGB8;
rrb->base._BaseFormat = GL_RGB;
rrb->base.RedBits = 8;
rrb->base.GreenBits = 8;
rrb->base.BlueBits = 8;
rrb->base.AlphaBits = 8;
rrb->base.DataType = GL_UNSIGNED_BYTE;
break;
case GL_RGBA8:
rrb->base._ActualFormat = GL_RGBA8;
rrb->base._BaseFormat = GL_RGBA;

View file

@ -1234,7 +1234,7 @@ radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv,
const GLboolean swAccum = mesaVis->accumRedBits > 0;
const GLboolean swStencil = mesaVis->stencilBits > 0 &&
mesaVis->depthBits != 24;
GLenum rgbFormat = (mesaVis->redBits == 5 ? GL_RGB5 : GL_RGBA8);
GLenum rgbFormat;
struct radeon_framebuffer *rfb;
if (isPixmap)
@ -1246,6 +1246,13 @@ radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv,
_mesa_initialize_framebuffer(&rfb->base, mesaVis);
if (mesaVis->redBits == 5)
rgbFormat = GL_RGB5;
else if (mesaVis->alphaBits == 0)
rgbFormat = GL_RGB8;
else
rgbFormat = GL_RGBA8;
/* front color renderbuffer */
rfb->color_rb[0] = radeon_create_renderbuffer(rgbFormat, driDrawPriv);
_mesa_add_renderbuffer(&rfb->base, BUFFER_FRONT_LEFT, &rfb->color_rb[0]->base);

View file

@ -261,7 +261,11 @@ s8z24_to_z24s8(uint32_t val)
#define TAG(x) radeon##x##_xRGB8888
#define TAG2(x,y) radeon##x##_xRGB8888##y
#define GET_PTR(X,Y) radeon_ptr32(rrb, (X) + x_off, (Y) + y_off)
#define GET_VALUE(_x, _y) ((*(GLuint*)(radeon_ptr32(rrb, _x + x_off, _y + y_off)) | 0xff000000))
#define PUT_VALUE(_x, _y, d) { \
GLuint *_ptr = (GLuint*)radeon_ptr32( rrb, _x + x_off, _y + y_off ); \
*_ptr = d; \
} while (0)
#include "spantmp2.h"
/* 32 bit, ARGB8888 color spanline and pixel functions