glsl/glcpp: Swallow empty #pragma directives.
Previously, we were passing these through, just like any other pragma. But the downstream compiler was tripping up on them. It seems easier to swallow these in the preprocessor and not pass them on at all rather than fixing the downstream compiler. This fixes the following Khronos GLES3 CTS tests: preprocessor.pragmas.pragma_vertex preprocessor.pragmas.pragma_fragment Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
@@ -287,6 +287,12 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
||||
RETURN_STRING_TOKEN (VERSION_TOKEN);
|
||||
}
|
||||
|
||||
/* Swallow empty #pragma directives, (to avoid confusing the
|
||||
* downstream compiler). */
|
||||
<HASH>pragma{HSPACE}*/[\r\n] {
|
||||
BEGIN INITIAL;
|
||||
}
|
||||
|
||||
/* glcpp doesn't handle #extension, #version, or #pragma directives.
|
||||
* Simply pass them through to the main compiler's lexer/parser. */
|
||||
<HASH>(extension|pragma)[^\r\n]* {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
|
||||
|
||||
#pragma
|
||||
|
||||
|
||||
Reference in New Issue
Block a user