diff options
author | Timothy Arceri <[email protected]> | 2019-08-14 14:24:31 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2019-11-20 05:05:55 +0000 |
commit | 67b32190f3c953c5b7091d76ddeff95c0cbfb439 (patch) | |
tree | f80299cbb521fb547dd685dd46a5aae6b06bc7ef /src/compiler/glsl/ast.h | |
parent | 2497c517176c2c9bd418d7d54eaef9aba0711727 (diff) |
glsl: add ARB_shading_language_include support to #line
From the ARB_shading_language_include spec:
"#line must have, after macro substitution, one of the following
forms:
#line <line>
#line <line> <source-string-number>
#line <line> "<path>"
where <line> and <source-string-number> are constant integer
expressions and <path> is a valid string for a path supplied in the
#include directive. After processing this directive (including its
new-line), the implementation will behave as if it is compiling at
line number <line> and source string number <source-string-number>
or <path> path. Subsequent source strings will be numbered
sequentially, until another #line directive overrides that
numbering."
Reviewed-by: Witold Baryluk <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast.h')
-rw-r--r-- | src/compiler/glsl/ast.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h index f07a14bce8f..67b258ce538 100644 --- a/src/compiler/glsl/ast.h +++ b/src/compiler/glsl/ast.h @@ -77,6 +77,7 @@ public: { struct YYLTYPE locp; + locp.path = this->location.path; locp.source = this->location.source; locp.first_line = this->location.first_line; locp.first_column = this->location.first_column; @@ -93,6 +94,7 @@ public: */ void set_location(const struct YYLTYPE &locp) { + this->location.path = locp.path; this->location.source = locp.source; this->location.first_line = locp.first_line; this->location.first_column = locp.first_column; @@ -107,6 +109,7 @@ public: */ void set_location_range(const struct YYLTYPE &begin, const struct YYLTYPE &end) { + this->location.path = begin.path; this->location.source = begin.source; this->location.first_line = begin.first_line; this->location.last_line = end.last_line; @@ -118,6 +121,7 @@ public: * Source location of the AST node. */ struct { + char *path; /**< GLSL shader include path. */ unsigned source; /**< GLSL source number. */ unsigned first_line; /**< First line number within the source string. */ unsigned first_column; /**< First column in the first line. */ |