summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-01-16 12:29:15 -0700
committerIan Romanick <ian.d.romanick@intel.com>2012-01-27 18:02:40 -0800
commita36cc604cfd44883c45b0936d62eb81a9c222552 (patch)
tree91c04d17d8f6f7ee1443653c869a8eabe6dc936b
parent73ed8cec4a959124fd4081c99e87594a1e480e12 (diff)
swrast: new swrast_renderbuffer type
This will let us move the swrast-specific fields out of gl_renderbuffer. (cherry picked from commit 34988272d9c7a889a26bb8bdcb841d44797a5dd6)
-rw-r--r--src/mesa/swrast/s_context.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index 7f1e4c78ee4..f03f0485bcd 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -168,6 +168,31 @@ swrast_texture_image_const(const struct gl_texture_image *img)
/**
+ * Subclass of gl_renderbuffer with extra fields needed for software
+ * rendering.
+ */
+struct swrast_renderbuffer
+{
+ struct gl_renderbuffer Base;
+
+ GLubyte *Buffer; /**< The malloc'd memory for buffer */
+
+ /** These fields are only valid while buffer is mapped for rendering */
+ GLubyte *Map;
+ GLint RowStride; /**< in bytes */
+};
+
+
+/** cast wrapper */
+static inline struct swrast_renderbuffer *
+swrast_renderbuffer(struct gl_renderbuffer *img)
+{
+ return (struct swrast_renderbuffer *) img;
+}
+
+
+
+/**
* \struct SWcontext
* \brief Per-context state that's private to the software rasterizer module.
*/