aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_fbo.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-12-12 12:23:04 +0100
committermarha <marha@users.sourceforge.net>2011-12-12 12:23:04 +0100
commit5efb0a5e19b75137b7294b27f4e7878aeb8f0927 (patch)
treea8138a3cf2f3ed5beacd1ce9e44dda79b51f9ffd /mesalib/src/mesa/state_tracker/st_cb_fbo.c
parent5b178ff5a5f0b6e481cf9fd9749eb7ef9581c987 (diff)
downloadvcxsrv-5efb0a5e19b75137b7294b27f4e7878aeb8f0927.tar.gz
vcxsrv-5efb0a5e19b75137b7294b27f4e7878aeb8f0927.tar.bz2
vcxsrv-5efb0a5e19b75137b7294b27f4e7878aeb8f0927.zip
libxtrans libX11 libxcb xserver mesa git update 12 dec 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_fbo.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_fbo.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c
index 2a60ed4df..ec40a2b70 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c
@@ -667,6 +667,22 @@ st_MapRenderbuffer(struct gl_context *ctx,
unsigned usage;
GLuint y2;
+ if (strb->software) {
+ /* software-allocated renderbuffer (probably an accum buffer) */
+ GLubyte *map = (GLubyte *) strb->data;
+ if (strb->data) {
+ map += strb->stride * y;
+ map += util_format_get_blocksize(strb->format) * x;
+ *mapOut = map;
+ *rowStrideOut = strb->stride;
+ }
+ else {
+ *mapOut = NULL;
+ *rowStrideOut = 0;
+ }
+ return;
+ }
+
usage = 0x0;
if (mode & GL_MAP_READ_BIT)
usage |= PIPE_TRANSFER_READ;
@@ -716,6 +732,11 @@ st_UnmapRenderbuffer(struct gl_context *ctx,
struct st_renderbuffer *strb = st_renderbuffer(rb);
struct pipe_context *pipe = st->pipe;
+ if (strb->software) {
+ /* software-allocated renderbuffer (probably an accum buffer) */
+ return;
+ }
+
pipe_transfer_unmap(pipe, strb->transfer);
pipe->transfer_destroy(pipe, strb->transfer);
strb->transfer = NULL;