summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.h
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-10-12 23:17:02 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-10-12 23:17:02 +0000
commit76e778dce59aa6f290db50242df945943fc47b05 (patch)
tree07ad7bf3d7a54f49e86ff650fc7a9d4ce5d40338 /src/mesa/swrast/s_context.h
parent4bb9f4115c4b1930a140da78feff953e80f8a4f5 (diff)
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.
Diffstat (limited to 'src/mesa/swrast/s_context.h')
-rw-r--r--src/mesa/swrast/s_context.h10
1 files changed, 10 insertions, 0 deletions
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.