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:
parent
3c2c59eed3
commit
5b76b3978d
|
@ -353,6 +353,15 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
||||||
|
|
||||||
gl_version = epoxy_gl_version();
|
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
|
/* We'd like to require GL_ARB_map_buffer_range or
|
||||||
* GL_OES_map_buffer_range, since it offers more information to
|
* GL_OES_map_buffer_range, since it offers more information to
|
||||||
* the driver than plain old glMapBuffer() or glBufferSubData().
|
* the driver than plain old glMapBuffer() or glBufferSubData().
|
||||||
|
|
|
@ -205,6 +205,7 @@ typedef struct glamor_screen_private {
|
||||||
Bool yInverted;
|
Bool yInverted;
|
||||||
unsigned int tick;
|
unsigned int tick;
|
||||||
enum glamor_gl_flavor gl_flavor;
|
enum glamor_gl_flavor gl_flavor;
|
||||||
|
int glsl_version;
|
||||||
int has_pack_invert;
|
int has_pack_invert;
|
||||||
int has_fbo_blit;
|
int has_fbo_blit;
|
||||||
int has_map_buffer_range;
|
int has_map_buffer_range;
|
||||||
|
|
|
@ -240,16 +240,8 @@ glamor_build_program(ScreenPtr screen,
|
||||||
flags |= fill->flags;
|
flags |= fill->flags;
|
||||||
version = MAX(version, fill->version);
|
version = MAX(version, fill->version);
|
||||||
|
|
||||||
if (version >= 130) {
|
if (version > glamor_priv->glsl_version)
|
||||||
|
goto fail;
|
||||||
/* 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 ||
|
|
||||||
epoxy_gl_version() < 30) {
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vs_vars = vs_location_vars(locations);
|
vs_vars = vs_location_vars(locations);
|
||||||
fs_vars = fs_location_vars(locations);
|
fs_vars = fs_location_vars(locations);
|
||||||
|
|
Loading…
Reference in New Issue