diff options
author | wm4 <wm4@nowhere> | 2017-11-03 11:39:15 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-11-03 11:39:15 +0100 |
commit | aac74b7c367feba4329f475c4b4f22ea7c4679d9 (patch) | |
tree | 878e0c7e1ceaa9eda4dabea76adc7c42195313b5 /video/out/opengl/ra_gl.c | |
parent | b86fb0f3e95b9f2155264415d8f819e19b0c26a2 (diff) | |
download | mpv-aac74b7c367feba4329f475c4b4f22ea7c4679d9.tar.bz2 mpv-aac74b7c367feba4329f475c4b4f22ea7c4679d9.tar.xz |
vo_gpu: ra_gl: fix crash trying to use glBindBufferBase on GL 2.1
Apparently this is required, but it doesn't check for it. To be fair,
this was tested by creating a compatibility context and pretending it's
GL 2.1. GL_ARB_shader_storage_buffer_object actually requires GL 4.0 or
up, but GL_ARB_uniform_buffer_object requires only GL 2.0.
Diffstat (limited to 'video/out/opengl/ra_gl.c')
-rw-r--r-- | video/out/opengl/ra_gl.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c index ccb8755ba6..ae6cd00765 100644 --- a/video/out/opengl/ra_gl.c +++ b/video/out/opengl/ra_gl.c @@ -102,8 +102,6 @@ static int ra_init_gl(struct ra *ra, GL *gl) {RA_CAP_TEX_3D, MPGL_CAP_3D_TEX}, {RA_CAP_COMPUTE, MPGL_CAP_COMPUTE_SHADER}, {RA_CAP_NESTED_ARRAY, MPGL_CAP_NESTED_ARRAY}, - {RA_CAP_BUF_RO, MPGL_CAP_UBO}, - {RA_CAP_BUF_RW, MPGL_CAP_SSBO}, }; for (int i = 0; i < MP_ARRAY_SIZE(caps_map); i++) { @@ -111,6 +109,13 @@ static int ra_init_gl(struct ra *ra, GL *gl) ra->caps |= caps_map[i][0]; } + if (gl->BindBufferBase) { + if (gl->mpgl_caps & MPGL_CAP_UBO) + ra->caps |= RA_CAP_BUF_RO; + if (gl->mpgl_caps & MPGL_CAP_SSBO) + ra->caps |= RA_CAP_BUF_RW; + } + if (gl->BlitFramebuffer) ra->caps |= RA_CAP_BLIT; |