mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
glsl: error if #include used while extension is disabled
In other words make sure the shader does this: Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
This commit is contained in:
parent
13a1426b97
commit
5327b756bf
2 changed files with 15 additions and 0 deletions
|
|
@ -377,6 +377,13 @@ control_line_success:
|
|||
glcpp_parser_copy_defines,
|
||||
&di);
|
||||
|
||||
/* Print out '#include' to the glsl parser. We do this
|
||||
* so that it can do the error checking require to
|
||||
* make sure the ARB_shading_language_include
|
||||
* extension is enabled.
|
||||
*/
|
||||
_mesa_string_buffer_printf(parser->output, "#include\n");
|
||||
|
||||
/* Parse the include string before adding to the
|
||||
* preprocessor output.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue