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.
This commit is contained in:
wm4 2017-11-03 11:39:15 +01:00
parent b86fb0f3e9
commit aac74b7c36
1 changed files with 7 additions and 2 deletions

View File

@ -102,8 +102,6 @@ static int ra_init_gl(struct ra *ra, GL *gl)
{RA_CAP_TEX_3D, MPGL_CAP_3D_TEX}, {RA_CAP_TEX_3D, MPGL_CAP_3D_TEX},
{RA_CAP_COMPUTE, MPGL_CAP_COMPUTE_SHADER}, {RA_CAP_COMPUTE, MPGL_CAP_COMPUTE_SHADER},
{RA_CAP_NESTED_ARRAY, MPGL_CAP_NESTED_ARRAY}, {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++) { 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]; 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) if (gl->BlitFramebuffer)
ra->caps |= RA_CAP_BLIT; ra->caps |= RA_CAP_BLIT;