This is maybe a bit heavy-handed (there are cases where shaders could
run in parallel), but it's by far the simplest thing to do, since we
have zero control over what happens to the textures we use when they
are handed back to the resource pool.
// since they can be updated from there.
setup_uniforms(phase);
glDispatchCompute(x, y, z);
+ check_error();
+ glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT | GL_TEXTURE_UPDATE_BARRIER_BIT);
+ check_error();
} else {
// Uniforms need to come after set_gl_state(), since they can be updated
// from there.