From aac74b7c367feba4329f475c4b4f22ea7c4679d9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 3 Nov 2017 11:39:15 +0100 Subject: 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. --- video/out/opengl/ra_gl.c | 9 +++++++-- 1 file 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; -- cgit v1.2.3