st/mesa: only define GLSL 1.4 for compat if driver supports it
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 16 May 2018 14:02:54 +0000 (16:02 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 18 May 2018 08:46:24 +0000 (10:46 +0200)
Currently GLSL 1.4 is defined for all gallium drivers even only
GLSL 1.2 is supported as seen on etnaviv.

v1 -> v2:
 - use _min(..) as suggested by Lucas Stach and Michel Dänzer

Fixes: 4560aad780b ("mesa: add GLSLVersionCompat constant")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/state_tracker/st_extensions.c

index 19ef736e5b0ee440aea1dcb26cf14764c06a2755..2d56a880273cf10dd8d773ca5551edeeb148f75f 100644 (file)
@@ -936,7 +936,7 @@ void st_init_extensions(struct pipe_screen *screen,
 
    /* Figure out GLSL support and set GLSLVersion to it. */
    consts->GLSLVersion = screen->get_param(screen, PIPE_CAP_GLSL_FEATURE_LEVEL);
-   consts->GLSLVersionCompat = 140;
+   consts->GLSLVersionCompat = _min(consts->GLSLVersion, 140);
 
    _mesa_override_glsl_version(consts);