diff options
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_fbo.c')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_fbo.c | 21 |
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; |