Clean up redundant initialization of gl_Position
In case gl_Position is statically used in the input shader, setting
the INIT_OUTPUT_VARIABLES flag will initialize gl_Position. Avoid
redundant initialization of gl_Position in this case.
Includes cleaning up memory management in InitOutputVariables_test:
all the pool-allocated variables will be freed at the end of each test
when the memory pool is cleared, so manual memory management is not
needed.
Also includes making the zero node check used in unit tests stricter
so that the tests are more reliable and moving it to
ShaderCompileTreeTest.h so that it can be reused in the future.
BUG=angleproject:2092
TEST=angle_unittests
Change-Id: I323a0a094afa6cea95c8a64e681d9fc485137423
Reviewed-on: https://chromium-review.googlesource.com/549418
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/Compiler.h b/src/compiler/translator/Compiler.h
index fcb3ac0..f7cf9e5 100644
--- a/src/compiler/translator/Compiler.h
+++ b/src/compiler/translator/Compiler.h
@@ -187,6 +187,8 @@
bool variablesCollected;
+ bool mGLPositionInitialized;
+
// Removes unused function declarations and prototypes from the AST
class UnusedPredicate;
bool pruneUnusedFunctions(TIntermBlock *root);