commit | 94ac7b786f2ae1e928ca872e58ca4399df96532a | [log] [tgz] |
---|---|---|
author | Zhenyao Mo <zmo@chromium.org> | Wed Oct 15 18:22:08 2014 -0700 |
committer | Zhenyao Mo <zmo@chromium.org> | Tue Oct 21 17:31:41 2014 +0000 |
tree | ad567670811b17da0bf68ebf6edd2f9c45c76711 | |
parent | f99b0cff3cde430d246b04a3c305df5170fca171 [diff] [blame] |
Invariant related processing. * Fix a bug in PreProcessor for STDGL pragma. * Record all invariant settings and set them in ShaderVariable. * Write #pragma STDGL invariant(all) in GL BUG=angle:776 TEST=https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/shaders-with-invariance.html Change-Id: Ie28b75480deed79f0c9f26e3b98f1778d1290182 Reviewed-on: https://chromium-review.googlesource.com/223610 Tested-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/preprocessor/DirectiveParser.cpp b/src/compiler/preprocessor/DirectiveParser.cpp index 6434d5c..e455c36 100644 --- a/src/compiler/preprocessor/DirectiveParser.cpp +++ b/src/compiler/preprocessor/DirectiveParser.cpp
@@ -592,6 +592,11 @@ int state = PRAGMA_NAME; mTokenizer->lex(token); + bool stdgl = token->text == "STDGL"; + if (stdgl) + { + mTokenizer->lex(token); + } while ((token->type != '\n') && (token->type != Token::LAST)) { switch(state++) @@ -627,7 +632,7 @@ } else if (state > PRAGMA_NAME) // Do not notify for empty pragma. { - mDirectiveHandler->handlePragma(token->location, name, value); + mDirectiveHandler->handlePragma(token->location, name, value, stdgl); } }