diff options
author | Brian Paul <brianp@vmware.com> | 2013-02-18 08:36:35 -0700 |
---|---|---|
committer | Andreas Boll <andreas.boll.dev@gmail.com> | 2013-04-17 12:33:14 +0200 |
commit | 1d4044ba294bc5f47486b59ec7ff7a925df8a1cf (patch) | |
tree | 81bce7e55eced14095cde7e4cf64ab2ae90c4834 | |
parent | a46c6765ba5e8d2833cbe4cafba12e443e0c1b0f (diff) |
st/mesa: implement glBitmap unpacking from a PBO, for the cache path
We weren't mapping the PBO when using the bitmap cache (but we had
the PBO code for the non-cache path.)
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=61026
Note: This is a candidate for the stable branches.
(cherry picked from commit 63c30d7e4fd9676c72d5d94640e1e136bd9dd09f)
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 84ac4ffbc0..250c27db16 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -688,11 +688,12 @@ st_flush_bitmap_cache(struct st_context *st) * \return GL_TRUE for success, GL_FALSE if bitmap is too large, etc. */ static GLboolean -accum_bitmap(struct st_context *st, +accum_bitmap(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap ) { + struct st_context *st = ctx->st; struct bitmap_cache *cache = st->bitmap.cache; int px = -999, py = -999; const GLfloat z = st->ctx->Current.RasterPos[2]; @@ -742,9 +743,17 @@ accum_bitmap(struct st_context *st, /* create the transfer if needed */ create_cache_trans(st); + /* PBO source... */ + bitmap = _mesa_map_pbo_source(ctx, unpack, bitmap); + if (!bitmap) { + return FALSE; + } + unpack_bitmap(st, px, py, width, height, unpack, bitmap, cache->buffer, BITMAP_CACHE_WIDTH); + _mesa_unmap_pbo_source(ctx, unpack); + return GL_TRUE; /* accumulated */ } @@ -777,7 +786,7 @@ st_Bitmap(struct gl_context *ctx, GLint x, GLint y, semantic_indexes); } - if (UseBitmapCache && accum_bitmap(st, x, y, width, height, unpack, bitmap)) + if (UseBitmapCache && accum_bitmap(ctx, x, y, width, height, unpack, bitmap)) return; pt = make_bitmap_texture(ctx, width, height, unpack, bitmap); |