summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-08-29 11:36:51 +1000
committerTimothy Arceri <[email protected]>2018-08-30 09:51:57 +1000
commit28a3731e3f4688f98a909cddee261eceb47e3523 (patch)
treedc8fccc619398b94fcac1b3ea81c71d931fcd54b /src
parent4738b6ac81422ad4498dc6554dae9d0170fcefc7 (diff)
glsl: skip stringification in preprocessor if in unreachable branch
This fixes compilation of some "No Mans Sky" shaders where the stringification happens in branches intended for DX12. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/glcpp/glcpp-lex.l6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/glsl/glcpp/glcpp-lex.l b/src/compiler/glsl/glcpp/glcpp-lex.l
index 9cfcc120222..fe5845acd4e 100644
--- a/src/compiler/glsl/glcpp/glcpp-lex.l
+++ b/src/compiler/glsl/glcpp/glcpp-lex.l
@@ -420,8 +420,10 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
/* This will catch any non-directive garbage after a HASH */
<HASH>{NONSPACE} {
- BEGIN INITIAL;
- RETURN_TOKEN (GARBAGE);
+ if (!parser->skipping) {
+ BEGIN INITIAL;
+ RETURN_TOKEN (GARBAGE);
+ }
}
/* An identifier immediately followed by '(' */