aboutsummaryrefslogtreecommitdiff
path: root/render/gles2
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-06-29 17:08:32 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-09-10 13:16:10 -0400
commit4e7a8707cce75b4cdc046581ec0c1cc7c0c26e02 (patch)
tree34d086a258df5567d832e28d4622e19ec3517354 /render/gles2
parent105fdecd0cd893c4ae1e21f78c67404f70859af8 (diff)
buffer: add data_ptr access flags
This allows callers to specify the operations they'll perform on the returned data pointer. The motivations for this are: - The upcoming Linux MAP_NOSIGBUS flag may only be usable on read-only mappings. - gbm_bo_map with GBM_BO_TRANSFER_READ hurts performance.
Diffstat (limited to 'render/gles2')
-rw-r--r--render/gles2/texture.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index 0368c1a1..64ac05ac 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -346,7 +346,8 @@ struct wlr_texture *gles2_texture_from_buffer(struct wlr_renderer *wlr_renderer,
struct wlr_dmabuf_attributes dmabuf;
if (wlr_buffer_get_dmabuf(buffer, &dmabuf)) {
return gles2_texture_from_dmabuf_buffer(renderer, buffer, &dmabuf);
- } else if (buffer_begin_data_ptr_access(buffer, &data, &format, &stride)) {
+ } else if (buffer_begin_data_ptr_access(buffer,
+ WLR_BUFFER_DATA_PTR_ACCESS_READ, &data, &format, &stride)) {
struct wlr_texture *tex = gles2_texture_from_pixels(wlr_renderer,
format, stride, buffer->width, buffer->height, data);
buffer_end_data_ptr_access(buffer);