From 76e778dce59aa6f290db50242df945943fc47b05 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Oct 2006 23:17:02 +0000 Subject: Lots of changes to support runtime renderbuffer depths. _swrast_read_rgba_span() now takes a datatype parameter. New optimization for glReadPixels(format=GL_RGB). New glCopyPixels optimization for the simple, common cases. --- src/mesa/swrast/s_context.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa/swrast/s_context.h') diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 6ccee5438e..37d7081d4d 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -432,6 +432,16 @@ _swrast_validate_derived( GLcontext *ctx ); +/** + * Size of an RGBA pixel, in bytes, for given datatype. + */ +#define RGBA_PIXEL_SIZE(TYPE) \ + ((TYPE == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : \ + ((TYPE == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) \ + : 4 * sizeof(GLfloat))) + + + /* * XXX these macros are just bandages for now in order to make * CHAN_BITS==32 compile cleanly. -- cgit v1.2.3