diff options
Diffstat (limited to 'video/out/opengl/ra_gl.c')
-rw-r--r-- | video/out/opengl/ra_gl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c index 7112464e87..1101f44c49 100644 --- a/video/out/opengl/ra_gl.c +++ b/video/out/opengl/ra_gl.c @@ -124,6 +124,12 @@ static int ra_init_gl(struct ra *ra, GL *gl) if (gl->BlitFramebuffer) ra->caps |= RA_CAP_BLIT; + // Disable compute shaders for GLSL < 420. This work-around is needed since + // some buggy OpenGL drivers expose compute shaders for lower GLSL versions, + // despite the spec requiring 420+. + if (ra->glsl_version < 420) + ra->caps &= ~RA_CAP_COMPUTE; + int gl_fmt_features = gl_format_feature_flags(gl); for (int n = 0; gl_formats[n].internal_format; n++) { @@ -542,7 +548,9 @@ static void gl_buf_destroy(struct ra *ra, struct ra_buf *buf) GL *gl = ra_gl_get(ra); struct ra_buf_gl *buf_gl = buf->priv; - gl->DeleteSync(buf_gl->fence); + if (buf_gl->fence) + gl->DeleteSync(buf_gl->fence); + if (buf->data) { gl->BindBuffer(buf_gl->target, buf_gl->buffer); gl->UnmapBuffer(buf_gl->target); |