opengl: fix and refine memory barriers
The current memory barriers were either used illegally (tex_gl->target??), overspecified (e.g. the forced barrier after glDispatchCompute), or just plain missing (e.g. barriers for storage images that might also be used in other ways).
Fix this mess by making the barrier usage consistent:
- Only submit memory barriers on descriptors when unbinding them from shaders that might write to the resource
- Skip unnecessary memory barriers for readonly resources
- Submit all the barriers required for the object's usage flags