diff options
author | Timothy Arceri <[email protected]> | 2019-08-20 14:20:33 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2019-11-20 05:05:55 +0000 |
commit | 5327b756bf3c9f3779a90900ac06c6bcb8976951 (patch) | |
tree | 699da4546c10b1bcf82b751e29f44439d8485543 /src/compiler/glsl/glsl_lexer.ll | |
parent | 13a1426b97c2ff1e42f7455f1f9937fe956c17b2 (diff) |
glsl: error if #include used while extension is disabled
In other words make sure the shader does this:
Reviewed-by: Witold Baryluk <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glsl_lexer.ll')
-rw-r--r-- | src/compiler/glsl/glsl_lexer.ll | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_lexer.ll b/src/compiler/glsl/glsl_lexer.ll index 8c59e1d748f..7d7ee0c00ff 100644 --- a/src/compiler/glsl/glsl_lexer.ll +++ b/src/compiler/glsl/glsl_lexer.ll @@ -236,6 +236,14 @@ PATH ["][./ _A-Za-z0-9]*["] ^[ \t]*#[ \t]*$ ; ^[ \t]*#[ \t]*version { BEGIN PP; return VERSION_TOK; } ^[ \t]*#[ \t]*extension { BEGIN PP; return EXTENSION; } +{HASH}include { + if (!yyextra->ARB_shading_language_include_enable) { + struct _mesa_glsl_parse_state *state = yyextra; + _mesa_glsl_error(yylloc, state, + "ARB_shading_language_include required " + "to use #include"); + } +} {HASH}line{SPCP}{INT}{SPCP}{INT}{SPC}$ { /* Eat characters until the first digit is * encountered |