aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_context.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-12-25 17:34:25 +0100
committerMarc Haesen <marc@hc-consult.be>2011-12-25 17:34:25 +0100
commit7fd4689bd7bac15dcc0ab13d4689a11e2c303681 (patch)
treec5bd75a1fc913dcb08d03525d87638e66fa8aad2 /mesalib/src/mesa/swrast/s_context.h
parent1a9e93b01e2339579bf9a0fae0db0f83b653aab7 (diff)
parent0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1 (diff)
downloadvcxsrv-7fd4689bd7bac15dcc0ab13d4689a11e2c303681.tar.gz
vcxsrv-7fd4689bd7bac15dcc0ab13d4689a11e2c303681.tar.bz2
vcxsrv-7fd4689bd7bac15dcc0ab13d4689a11e2c303681.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/swrast/s_context.h')
-rw-r--r--mesalib/src/mesa/swrast/s_context.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/mesalib/src/mesa/swrast/s_context.h b/mesalib/src/mesa/swrast/s_context.h
index 446b990d9..af9e49ecb 100644
--- a/mesalib/src/mesa/swrast/s_context.h
+++ b/mesalib/src/mesa/swrast/s_context.h
@@ -422,5 +422,17 @@ _swrast_unmap_renderbuffers(struct gl_context *ctx);
#define ATTRIB_LOOP_END } }
+/**
+ * Return the address of a pixel value in a mapped renderbuffer.
+ */
+static inline GLubyte *
+_swrast_pixel_address(struct gl_renderbuffer *rb, GLint x, GLint y)
+{
+ const GLint bpp = _mesa_get_format_bytes(rb->Format);
+ const GLint rowStride = rb->RowStride * bpp;
+ return (GLubyte *) rb->Data + y * rowStride + x * bpp;
+}
+
+
#endif