• Thibault Lemaire's avatar
    Add support for OpenGL 4.1 & GLSL 4.10 · fca427e9
    Thibault Lemaire authored
    On macOS the OpenGL implementation supports either OpenGL 2.1 or OpenGL
    4.1 Core Profile (and nothing else). Also, with the OpenGL 4.1 Core
    Profile, only GLSL 4.10 is supported.
    The existing code and shaders were compatible with 2.1, but 4.1 Core
    (and GLSL 4.10) has some breaking changes.
    This commit adds support for OpenGL 4.1 in a way that's
    backward-compatible with any previous version down to 2.0.
    Additional notes:
    - ogl_display_render had to be made robust to OpenGL resets
      In the msqogl.cpp filter for example, we reset the OpenGL context with
      every frame, which breaks VAO and array buffer bindings.
    - Handling unusable OpenGL context
      In case we could load neither the new nor the legacy shaders, let us
      clean up and flag it to avoid rendering, which would only flood the
      logs with OpenGL errors.
    - The msqogl filter had to be fixed because it was reusing the OpenGL
      context across different windows
    - Some code has been added to measure GPU re...