From d099e037efa2ceaff96c775f5c6f8d1e74650b76 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 25 Jul 2017 06:11:57 +0200 Subject: vo_opengl: fix incoherent SSBO usage According to the OpenGL spec, atomic access to SSBO variables is *not* guaranteed to be coherent, even when reusing the same SSBO attached to the same shader across different frames. So we actually need a glMemoryBarrier here, at least in theory. --- video/out/opengl/video.c | 1 + 1 file changed, 1 insertion(+) (limited to 'video') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 5d94a62b2f..d1edfa02fb 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -2476,6 +2476,7 @@ static void pass_colormanage(struct gl_video *p, struct mp_colorspace src, bool gl->BindBuffer(GL_SHADER_STORAGE_BUFFER, 0); } + gl->MemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT); gl_sc_ssbo(p->sc, "PeakDetect", p->hdr_peak_ssbo, "uint sig_peak_raw;" "uint index;" -- cgit v1.2.3