glsl: Enable GLSL 1.30 if we have OpenGL 3.0/3.1

As implemented, we only support OpenGL 3 API from version 3.2. Though, there
is no issue enabling GLSL 1.30 even if we are going to restrict our API usage
to 2. This allows using texelFetch() on OpenGL 3.0 and 3.1 drivers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2190>
This commit is contained in:
Nicolas Dufresne 2022-04-13 14:54:40 -04:00 committed by GStreamer Marge Bot
parent 4b4d607f4c
commit 77a88c4572

View file

@ -897,7 +897,12 @@ _mangle_version_profile_from_gl_api (GstGLContext * context,
*profile = GST_GLSL_PROFILE_ES;
}
} else if (gl_api & GST_GL_API_OPENGL) {
*version = GST_GLSL_VERSION_110;
/* We only use GST_GL_API_OPENGL3 from 3.1, but nothing prevents us from
* using 3.0/1.30 GLSSL with GL2 API */
if (gl_major >= 3)
*version = GST_GLSL_VERSION_130;
else
*version = GST_GLSL_VERSION_110;
*profile = GST_GLSL_PROFILE_COMPATIBILITY;
}
}