summaryrefslogtreecommitdiff
path: root/glamor/glamor_pixmap.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-01-11 21:26:01 -0800
committerEric Anholt <eric@anholt.net>2014-03-17 14:30:57 -0700
commitd07d2c3c5f95fd644ef563004dfa7f3c53904168 (patch)
tree999f453badfa584cf38e295b41494d5500a23208 /glamor/glamor_pixmap.c
parent64146e4560fdf3c3a40d023ac8e22259915b05ad (diff)
glamor: Don't forget to unmap our PBOs before using them to upload.
From the GL_ARB_vertex_buffer_object spec: After the client has specified the contents of a mapped data store, and before the data in that store are dereferenced by any GL commands, the mapping must be relinquished by calling boolean UnmapBufferARB(enum target); Our mappings were only getting reaped at PBO destroy time, after the upload. If the GL implementation wasn't coherent, it would have used stale data to do the texture upload. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Markus Wick <markus@selfnet.de>
Diffstat (limited to 'glamor/glamor_pixmap.c')
-rw-r--r--glamor/glamor_pixmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c
index 1bbcc551b..1c258a2b8 100644
--- a/glamor/glamor_pixmap.c
+++ b/glamor/glamor_pixmap.c
@@ -726,8 +726,10 @@ __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex,
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
assert(pbo || bits != 0);
- if (bits == NULL)
+ if (bits == NULL) {
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo);
+ glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
+ }
if (non_sub)
glTexImage2D(GL_TEXTURE_2D, 0, iformat, w, h, 0, format, type, bits);
else