fix clipping for OpenGL buffers