glamor: Compute supported GLSL version and save in screen private

This currently computes the GLSL version in a fairly naïve fashion,
and leaves that in the screen private for other users. This will let
us update the version computation in one place later on.

v2: Drop an accidental rebase-squashed hunk (change by anholt).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Keith Packard 2014-04-01 21:15:42 -07:00
commit 5b76b3978d
3 changed files with 12 additions and 10 deletions

View file

@ -353,6 +353,15 @@ glamor_init(ScreenPtr screen, unsigned int flags)
gl_version = epoxy_gl_version();
/* Would be nice to have a cleaner test for GLSL 1.30 support,
* but for now this should suffice
*/
if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && gl_version >= 30)
glamor_priv->glsl_version = 130;
else
glamor_priv->glsl_version = 120;
/* We'd like to require GL_ARB_map_buffer_range or
* GL_OES_map_buffer_range, since it offers more information to
* the driver than plain old glMapBuffer() or glBufferSubData().