diff options
author | Timothy Arceri <[email protected]> | 2018-06-14 11:00:22 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-06-19 12:09:56 +1000 |
commit | 90dbab0f9a2e35595b7510595b464e654b870e3a (patch) | |
tree | f80364b32f4fe664d6e21f111a3e63a52b3587c0 /src/mesa | |
parent | de93f546a7f9f3407f88ea8dd2d4b3f7158e94ed (diff) |
mesa/util: add allow_glsl_builtin_const_expression driconf override
Google Earth VR shaders uses builtins in constant expressions with
GLSL 1.10. That feature wasn't allowed until GLSL 1.20.
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/mtypes.h | 6 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index ef9fce24d91..e7d9c03cfde 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3722,6 +3722,12 @@ struct gl_constants GLboolean AllowGLSLExtensionDirectiveMidShader; /** + * Allow builtins as part of constant expressions. This was not allowed + * until GLSL 1.20 this allows it everywhere. + */ + GLboolean AllowGLSLBuiltinConstantExpression; + + /** * Allow GLSL built-in variables to be redeclared verbatim */ GLboolean AllowGLSLBuiltinVariableRedeclaration; diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index c540cee3974..6586240cb03 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -1134,6 +1134,9 @@ void st_init_extensions(struct pipe_screen *screen, if (options->allow_glsl_extension_directive_midshader) consts->AllowGLSLExtensionDirectiveMidShader = GL_TRUE; + if (options->allow_glsl_builtin_const_expression) + consts->AllowGLSLBuiltinConstantExpression = GL_TRUE; + consts->MinMapBufferAlignment = screen->get_param(screen, PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT); |