diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-23 09:41:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-23 09:41:31 -0400 |
commit | 7cc042f54c04141512934958fe8547b34ee38357 (patch) | |
tree | 3769582f3e49174fac7bda1976c1b32aa657684e /render/gles2 | |
parent | 77d3be66eaabca4309794536984c54a5e94e9eb5 (diff) | |
parent | b1852096c52103cefd39bddc0a97071dae28c3f8 (diff) |
Merge pull request #724 from agx/linux-dmabuf-mp
Linux-dmabuf with n_planes > 1
Diffstat (limited to 'render/gles2')
-rw-r--r-- | render/gles2/texture.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/render/gles2/texture.c b/render/gles2/texture.c index 766c0b15..46193c78 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -275,9 +275,15 @@ static bool gles2_texture_upload_dmabuf(struct wlr_texture *wlr_texture, wlr_texture->inverted_y = true; } - GLenum target = GL_TEXTURE_2D; - const struct gles2_pixel_format *pf = - gles2_format_from_wl(WL_SHM_FORMAT_ARGB8888); + GLenum target; + const struct gles2_pixel_format *pf; + if (dmabuf->attributes.n_planes > 1) { + target = GL_TEXTURE_EXTERNAL_OES; + pf = &external_pixel_format; + } else { + target = GL_TEXTURE_2D; + pf = gles2_format_from_wl(WL_SHM_FORMAT_ARGB8888); + } GLES2_DEBUG_PUSH; gles2_texture_ensure(tex, target); glBindTexture(target, tex->tex_id); |