From 638342858894293246400d95a90d153c7f66719a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 25 May 2010 11:45:05 -0700 Subject: i965: Add support for GL_ALPHA framebuffer objects. --- src/mesa/drivers/dri/common/spantmp2.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/mesa/drivers/dri/common') diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index 98422a85647..1dab7336b9b 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -413,6 +413,38 @@ } while (0) # endif +#elif (SPANTMP_PIXEL_FMT == GL_ALPHA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_BYTE) + +/** + ** GL_ALPHA, GL_UNSIGNED_BYTE + **/ + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) ( buf + (_x) + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLubyte *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLubyte *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +# define INIT_MONO_PIXEL(p, color) \ + p = color[3] + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + PUT_VALUE(_x, _y, a | (r & 0 /* quiet warnings */)) + +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLubyte p = GET_VALUE(_x, _y); \ + rgba[0] = 0; \ + rgba[1] = 0; \ + rgba[2] = 0; \ + rgba[3] = p; \ + } while (0) + #else #error SPANTMP_PIXEL_FMT must be set to a valid value! #endif -- cgit v1.2.3